4

I am using Safari to develop for a while. One thing I always liked is when you clear the cache, it really does, unlike other browsers I tried in the past. But in previous versions, specially when working in a code in a local testing server, just reloading the page will reload everything from disk. Now I have to use de shortcut command+alt+e to clear before reload or some new CSS won't load, even some http request will return old values. Just reloading the page won't guarantee to show me the last modifications.

I looked at preferences and develop menu but didn't find an option to just don't use any caches at all - the perfect option will be don't use caches when I have the web inspector opened, means I am developing.

Did I miss this option, or there is another way to disable all caches?

6

In the Web Inspector, under the Network tab, unselect ‘Use the resource cache when loading resources’. Blue means the cache is not used, black means the cache is used.

                                                

As you wished, this only takes effect when the web inspector is open. Note that this is a cache bypass, not a permanent ‘cache empty’, so when you un-bypass the cache, any cache from prior to the bypass will be used. To use the latest resources with the web inspector closed, empty the cache using the button to the right or Develop → Empty Caches (⌥⌘E).

Currently, in Safari Technology Preview there is a re-designed Network tab in the Web Inspector with a new cache bypass icon, which I expect to make its way to Safari soon.

                                                

0

I'm not near my Mac right now, (was searching how to disable all caches in iOS Safari) but you could try to disable all write permissions to the Safari cache folder in Terminal. It might crash Safari, but probably it will just spam your log file with 'can't save cache' messages, so it might also slow down your Mac a tiny bit because of it constantly writing to the log.

Caveat: This hack solution might not survive an MacOS update, and might even cause problems during an update. I haven't actually tested this, don't have a Mac nearby, just an iPad, so a lot of mights.

  • Sounds like an inversion of a solution, Safari won't be able to write cache in first place. If you try it, please let us know de result. Might be a "final solution" in an extreme case... – Gustavo Sep 4 '18 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .