60

I have often experienced while developing my web applications that pressing F5 or refresh doesn't produce or refresh the proper result. But when we hit Ctrl + F5 it generates the correct result. What is the basic difference between simple F5 and Ctrl + F5?

I have often also experienced that pressing simple F5 and pressing the Refresh button in the browser also generate different results.

What is the basic difference among all these requests?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
  • and also what if we press enter in address bar of browser since I am getting different load times for F5, ctrl+F5, ctrl+R and (pressing enter in address bar), viewing in chrome browser's "Network" tab (ctrl+shift+i) – Prakash Joshi Aug 21 '15 at 07:35
  • 2
    Well, XKCD: https://xkcd.com/1854/ – Swanand Jun 26 '17 at 02:43

6 Answers6

63

CTRL+F5 Reloads the current page, ignoring cached content and generating the expected result.

DDA
  • 991
  • 10
  • 28
Alex
  • 8,875
  • 2
  • 27
  • 44
  • 3
    IMO CTRL +F5 displays new content only. It doesn't clear the cache it bypasses the cache https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache –  Feb 22 '19 at 11:54
46

I did small research regarding this topic and found different behavior for the browsers:

enter image description here

See my blog post "Behind refresh button" for more details.

Freek de Bruijn
  • 3,552
  • 2
  • 22
  • 28
Pavel Podlipensky
  • 8,201
  • 5
  • 42
  • 53
  • 1
    The blog post link changed to http://podlipensky.com/2012/03/behind-refresh-button/ – Mottie Apr 16 '13 at 15:04
  • 1
    The blog post can still be found via https://web.archive.org/web/20131026195830/http://podlipensky.com/2012/03/behind-refresh-button/ – Freek de Bruijn Mar 03 '19 at 11:17
13

F5 and the refresh button will look at your browser cache before asking the server for content.

Ctrl + F5 forces a load from the server.

You can set content expiration headers and/or meta tags to ensure the browser doesn't cache anything (perhaps something you can do only for the development environment).

Oded
  • 489,969
  • 99
  • 883
  • 1,009
7

F5 triggers a standard reload.

Ctrl + F5 triggers a forced reload. This causes the browser to re-download the page from the web server, ensuring that it always has the latest copy.

Unlike with F5, a forced reload does not display a cached copy of the page.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
4

F5 is a standard page reload.

and

Ctrl + F5 refreshes the page by clearing the cached content of the page.

Having the cursor in the address field and pressing Enter will also do the same as Ctrl + F5.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sumgeek
  • 76
  • 1
  • 13
  • 11
    No you are wrong. "Having cursor in the address field and pressing ENTER will also do" F5 and not CTRL+F5 in GOOGLE CHROME. I have verified this using 'Developer Console' in chrome. – Nidhin David Aug 02 '15 at 04:56
1

F5 reloads the page from server, but it uses the browser's cache for page elements like scripts, image, CSS stylesheets, etc, etc. But Ctrl + F5, reloads the page from the server and also reloads its contents from server and doesn't use local cache at all.

So by pressing F5 on, say, the Yahoo homepage, it just reloads the main HTML frame and then loads all other elements like images from its cache. If a new element was added or changed then it gets it from the server. But Ctrl + F5 reloads everything from the server.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131