3

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.

Mark
  • 16,906
  • 20
  • 84
  • 117
  • 1
    We have also noticed that Empty Cache and Develop > Disable Cache doesn't do anything, for sure. We are remotely debugging a page on an iPhone from a Mac desktop computer. With other device (namely Android phones), remote debugging with Chrome and having cache disabled via developer tools works like a charm. – Pere Aug 07 '15 at 14:15

3 Answers3

7

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.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • Is that also for MAC the case or don't you know that? Since in Windows you have CTRL+C and on mac its CMD+C – Mark Jul 12 '11 at 10:01
2

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.

Community
  • 1
  • 1
Mark
  • 16,906
  • 20
  • 84
  • 117
0

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.

Nate
  • 2,364
  • 1
  • 10
  • 16