MacOS – How to truly flush Safari’s cache

macossafari

There have been countless times where I run into a problem after I edit HTML on a Mac. The issue derives from me uploading the updated file to my server through FTP, and I'll navigate to the website in Safari. The one thing that didn't act properly was that Safari had already cached the webpage (the old version), so it would display the old version. I thought to myself and decided to clear the cache in Safari hoping it would solve my issue. Clearing the cache merely let the website appear to reload. It still came up with the old version of the file. To prove that the file on the server was actually updated, I got on another Mac on the same network, and it displayed the new version of the file. No matter how many times I refreshed or cleared the cache or reopened Safari, it would always deliver the old file. The only other solution I could come up with was to reboot. After a reboot, Safari reloaded the entire website and displayed the new version of the file.

I'm really just wondering how to flush Safari's cache and have it behave properly. Is this something the operating system does (I've had similar problems with files on my harddrive, too)? I don't want to have to reboot all the time just to see a new version of a file, so is there any way I can ensure I'm viewing the newest one? Is there a temporary storage folder that I can manually clear out? This happens to me quite often (not terribly frequent, but enough for me to notice), and my only current solution is to reboot.

I have strange feeling (it's not really a thought, but an ever so slight possiblilty that doesn't make much sense) that it's originating from a lower level.

Best Answer

In Safari, hold down down the (Shift) key while clicking the refresh button. This will perform a “hard” refresh, which bypasses the local cache.

(To quickly clear the cache in Safari, hit ++E, go to Privacy, and click “Remove All Website Data”.)