How to force the browser to reload cached CSS/JS files?

后端 未结 30 4348
青春惊慌失措
青春惊慌失措 2020-11-21 05:49

I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even be

30条回答
  •  不知归路
    2020-11-21 06:10

    Not sure why you guys are taking so much pain to implement this solution.

    All you need to do if get the file's modified timestamp and append it as a querystring to the file

    In PHP i would do it as:

    
    

    filemtime is a PHP function that returns the file modified timestamp.

提交回复
热议问题