Cache busting via params

前端 未结 12 1288
耶瑟儿~
耶瑟儿~ 2020-11-22 03:27

We want to cache bust on production deploys, but not waste a bunch of time off the bat figuring out a system for doing so. My thought was to apply a param to the end of css

12条回答
  •  Happy的楠姐
    2020-11-22 04:18

    Two questions: Will this effectively break the cache?

    Yes. Even Stack Overflow use this method, although I remember that they (with their millions of visitors per day and zillions of different client and proxy versions and configurations) have had some freak edge cases where even this was not enough to break the cache. But the general assumption is that this will work, and is a suitable method to break caching on clients.

    Will the param cause the browser to then never cache the response from that url since the param indicates that this is dynamic content?

    No. The parameter will not change the caching policy; the caching headers sent by the server still apply, and if it doesn't send any, the browser's defaults.

提交回复
热议问题