Issue 11641

Title
Add version parameter to use cache-busting for sao files
Priority
feature
Status
need-eg
Nosy list
acaubet, ced
Assigned to
Keywords

Created on 2022-08-11.12:10:42 by acaubet, last changed 3 months ago by ced.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-08-11.13:45:24

What will be the "version"?

More over I see no benefit if it is just the sao js file having such versioning. The index.html will not be updated, nor any of the other javascript files.
Also HTTP has already support for search requirement with the Cache-Control and etag.

And finally this goes against the plan to remove grunt https://discuss.tryton.org/t/state-of-the-dependencies-of-the-web-client/3441/7.

Author: [hidden] (acaubet)
Date: 2022-08-11.12:47:03

on index.html:
<script type="text/javascript" src="dist/tryton-sao.min.js?v={{ VERSION }}"></script>
and with grunt-string-replace: https://stackoverflow.com/a/20446748/6026007
the files list would be the index.html and with the same pattern and replacement of the example.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-08-11.12:19:37

I remove the easy flag because for nothing is easy in this feature.
Could you elaborate on how this can be done?

Author: [hidden] (acaubet)
Date: 2022-08-11.12:12:48

FTR, I suggest to use grunt-string-replace.

Author: [hidden] (acaubet)
Date: 2022-08-11.12:10:39

It's a common technique to use cache-busting to able the user to have the most recently updated files without having to perform a hard refresh or clear their browser cache.
We could have it at least for:

dist/tryton-sao.min.js?v=6.2.1
dist/tryton-sao.min.css?v=6.2.1

I also propose to include on all bower_components as normally when you use a CDN source the version is included on the link, so if developer change version it change also for the user the url. But with our setup the link is always the same path (E.g. src="bower_components/jquery/dist/jquery.min.js")

History
Date User Action Args
2022-08-11 13:45:24cedsetmessages: + msg77669
2022-08-11 12:47:03acaubetsetmessages: + msg77665
2022-08-11 12:19:38cedsetkeyword: - easy
messages: + msg77663
nosy: + ced
status: chatting -> need-eg
2022-08-11 12:12:48acaubetsetmessages: + msg77662
2022-08-11 12:10:42acaubetcreate