How to do a hard refresh in every browser

How to do a hard refresh in every browser

This is a common task during the development process โ€“ it’s important to be able to know how to do a hard refresh. The good news? It’s very easy. The bad news? Every browser is a little bit different.

What is a hard refresh?

Basically, when you visit a website, your computer downloads a bunch of files that comprise the page, and temporarily saves those. These can be image files, css files, javascript files, etc. The reason your computer temporarily saves them is that when you load the same page again (or another page that uses one of those same files), then that file can be loaded from local memory rather than downloading it again, which is much faster.

But this can cause problems โ€“ for example, if your web developer has just made some changes to files, and your machine has those same files cached, then you might not be able to see those changes (we take some steps to avoid this, but it comes up regularly).

Please do note that there are multiple layers of caching, and this can help with some of them, but not all of them:

  • Browser caching (that’s this one!)
  • DNS caching: that’s the cache that affects what server you connect to when you’re looking for a website. A hard refresh won’t help with this one.
  • Server-side caching: we do a lot of this as well โ€“ it’s combining and compressing files, allowing for your users to have to download a smaller number of files to see your website. There’s more to it than this, but the point here is that a hard refresh won’t show you new files if the server has the old files cached. So often when we’re pushing updates, we’ll clear that server-side cache as well, and then a hard refresh will help you see the most up-to-date version of the site.

How to do a hard refresh in Google Chrome

Chrome for Windows

First, go to the page you want to refresh. Then:

  • Hold down CTRL and press F5.
  • Or hold down Ctrl and click the reload button in your browser.

Chrome for Mac

First, go to the page you want to refresh. Then:

  • With the page loaded, push the CMD and SHIFT and R keys together
  • Or hold down CMD, then click the reload button in your browser

How to do a hard refresh in Mozilla Firefox

Firefox for Windows

First, go to the page you want to refresh. Then:

  • Hold down CTRL and press F5
  • Or hold down CTRL and SHIFT, then press R

Firefox for Mac

First, go to the page you want to refresh. Then:

  • Hold down the CTRL key, then press F5
  • Or hold down the CMD and SHIFT keys, then press R.

How to do a hard refresh in Safari

First, go to the page you want to refresh. Then:

  1. Hold the OPTION and CMD keys, then push E to empty the cache
  2. Then, after you’ve emptied the cache, push the refresh button in your browser or use the CMD + R key combination to refresh the browser

How to do a hard refresh in Internet Explorer or Edge

Please note that I’d never recommend that anyone use Internet Explorer or Edge. I’d highly recommend switching to Chrome. However, if you must, then go to the page you’d like to reload, then…

  • Hold down the CTRL key, then press F5
  • Or hold down the CTRL key and click the reload button in your browser

Comments

2 responses to “How to do a hard refresh in every browser”

  1. G. Scott FitzGibbon Avatar
    G. Scott FitzGibbon

    What about Safari on an iPhone?

    1. Jon Schroeder Avatar
      Jon Schroeder

      The best you’re probably going to be able to do is to 1) disconnect from wireless, then 2) load the site in incognito mode and 3) add ?cache to the end of the URL. Phones do more local caching than computers, so it’s harder to load them clean. Does that help?

Leave a Reply

Your email address will not be published. Required fields are marked *