F5andCtrlF5are triggered in web browsers?
I have done experiments in IE6 and Firefox 2.x.F5Refresh will trigger an HTTP request to the server that contains theIf-Modified-Since
header, whileCtrlF5does not There will be a title like this. From my understanding,F5will try to leverage as much of the cached content as possible, whileCtrlF5aims to discard all cached content and just retrieve all from the server again content.
But today, I noticed that in some of the latest browsers (Chrome, IE8) it no longer works this way.F5andCtrlF5both send theIf-Modified-Since
header.
So how is this supposed to work, or (if there's no standard) how do the major browsers differ in how they implement these refresh functions?
It depends on the browser, but they behave in similar ways.
F5Usually a page is updated only when it has been modified. Modern browsers send
Cache-Control: max-age=0
to tell the maximum time (relative to the time of the request) that any cached resource will be considered fresh.CTRL-F5is used to force an update, ignoring any cache. Modern browsers send
Cache-Control: no-cache
andPragma: No-cache
If I remember correctly, Netscape was the first browser to add cache control support by addingPragma: No-cachewhen pressing
CTRL
-F5.Note on Chrome 6.0.472: If you do a force reload (e.g.CTRL-F5), it will behave as if the URL is in Internally marked as always force reload. If you go to the address bar and press Enter, the flag will be cleared.
Generally speaking:
F5may serve you the same page even if the content changes because it may load the page from cache. ButCtrlF5will force a cache refresh and guarantee that if the content changes, you'll get the new content.