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

后端 未结 30 4343
青春惊慌失措
青春惊慌失措 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:04

    I've heard this called "auto versioning". The most common method is to include the static file's mtime somewhere in the URL, and strip it out using rewrite handlers or URL confs:

    See also:

    • Automatic asset versioning in Django
    • Automatically Version Your CSS and JavaScript Files

提交回复
热议问题