Why does Firefox sometimes cache my CSS & Javascript code, even though it has changed?

前端 未结 7 1930
情深已故
情深已故 2021-01-12 21:20

On my product site, Firefox sometimes \"doesnt detect\" changes in my CSS & Javascript code. Rather it loads the old versions, so it seems that I need to clear the cache

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 22:08

    You can append a version at the end of the css/js you send accross.

    For Example

    Instead of www.foo.com/js/javascript.js, send www.foo.com/js/javascript.js?v=1 and
    Instead of www.foo.com/css/style.css, send www.foo.com/css/style.js?v=1

提交回复
热议问题