Auto Version for Stylesheet and JavaScript files

Post Reply
mobhar
User
Posts: 11660

Auto Version for Stylesheet and JavaScript files

Post by mobhar »

We often must to customize the certain code in .css and .js files and then re-upload those files to the production server. Unfortunately, the End-Users cannot download and use those files via their browser, if they do not do the hard-refresh/reload the current page, moreover, for some cases, they have to reload those .css andd .js files via View Page Source of the browsers.

To overcome those issues, then please add the ability to add the sufix for each .css and .js files. So, instead of displaying this:
phpcss/demo2018.css

that would be better if we use such the following technique:
phpcss/demo2018.css?v=1522739106

The last format will auto detect the latest version. End-Users do not need the hard-refresh/reload again.

Thank you.


xxltomcat
User
Posts: 107

Post by xxltomcat »

Vote for this!


Adam
User
Posts: 480

Post by Adam »

+1


philmills
User
Posts: 535

Post by philmills »

+1


Adam
User
Posts: 480

Post by Adam »

+1 ...but:

a) there's no need for the "v=" part - just a number i.e. "?1234567" as the query is sufficient
b) it's better to use the file timestamp as in the example I posted so that manual changes to .css and .js files are taken into account - this is especially important for files that are not auto-generated


stefano
User
Posts: 24

Post by stefano »

+1


Webmaster
User
Posts: 9425

Post by Webmaster »

Try v2023.


Post Reply