htaccess - How to force the client's browser to clear the cache?

前端 未结 12 1413
情歌与酒
情歌与酒 2020-12-07 14:23

For my site I have the following htaccess rules:

# BEGIN Gzip

AddOutputFilterByType DEFLATE text/text text/html text/plain tex         


        
12条回答
  •  悲哀的现实
    2020-12-07 14:56

    In my case, I change a lot an specific JS file and I need it to be in its last version in all browsers where is being used.

    I do not have a specific version number for this file, so I simply hash the current date and time (hour and minute) and pass it as the version number:

    
    

    I need it to be loaded every minute, but you can decide when it should be reloaded.

提交回复
热议问题