JavaScript file not updating no matter what I do

前端 未结 13 740
粉色の甜心
粉色の甜心 2021-01-30 03:14

I have an external JavaScript file and whether in FireFox or Chrome, whether all browsing data is cleared, it will NOT update no matter what. I believe something happen

13条回答
  •  孤独总比滥情好
    2021-01-30 03:40

    How about adding a '?2' to the tag?

    The server should return the same file with or without the '?2', but the browser should see it as a different file and redownload. You can just change this query string whenever the file is changed.

    adapted from: http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/

提交回复
热议问题