开发者

Disable cache in browser

开发者 https://www.devze.com 2023-03-19 09:39 出处:网络
Issue I work a lot with stylesheets, I change something and I check how it looks. However most if not all current browsers, store the stylesheet and thus won\'t let me see the differences. Only with

Issue

I work a lot with stylesheets, I change something and I check how it looks. However most if not all current browsers, store the stylesheet and thus won't let me see the differences. Only with a lot of Reset Safari, Empty Cache button presses it suddenly updates but this is really annoying.

开发者_高级运维

Question

Is there a way to disable the cache feature in browsers? So it won't store any files and I will always fetch the latest css from the server.

Ps. Safari's Empty Cache and Reset Safari doesn't always clear the cache and Develop > Disable Cache doesn't seem to do anything.


In Chrome, IE, Firefox, and most other browsers, Ctrl+F5 ("hard refresh") will force reloading cached resources on the page. I do this all the time. I can't speak for Safari, but I'd expect it would do the same.

Edit: I just did a search for "+Safari +hard +refresh" and it looks like on the Mac, you hold down the Options key while clicking refresh. Some sources say Shift also works, and that Command+Option+E clears cache.


Thanks to T.J. Crowder for helping me in the right direction - I figured it out.

On Windows you can, in fact, press Ctrl+F5 to force the browser to refresh.

On Mac Safari you can hold the Shift button, then press the refresh button to do the same.


I just found that in the latest version of Safari for macOS, you can press Cmd+Option+R to hard refresh (as opposed to the standard Cmd+R that refreshes with a cache). This is a game changer for me!

Cmd+Shift+R just opens the Reader View on my Mac.

0

精彩评论

暂无评论...
验证码 换一张
取 消