|Post date: 2010-10-18 08:32|
Not many know of the hard refresh in web browsers and if they know of it they do not know what happens "under the hood". During the development of Domino Accelerator Pack I have had to look in depth into the mysterious Hard refresh.
First of all, a hard refresh is not when you hit the F5 key with a hammer ;) you initiate it like this:
Firefox: Hold down Shift button and click the reload icon. Or Shift-Ctrl-R.
Chrome: Hold down Ctrl button and clicking on reload icon. Or Shift-Ctrl-R.
Internet Explorer: Hold down Ctrl button and clicking on reload icon. Or Ctrl-F5.
The hard refresh forces all elements on a web page to be reloaded from the server. The browser will ignore any cached versions existing in memory or on disk on the client side and request everything from the server.
The web browser will also send an extra request header (Pragma: no-cache and some browsers also: Cache-Control: no-cache) signaling to the server that it wants the latest version and not a server cached version.
Do not confuse this with a simple reload. An ordinary reload will only refresh the base page and will just ask if there are any updates to the elements of the page.
Be aware though that requests made through Ajax calls, after the page has loaded will not be hard refreshed.
Any proxy servers along the way between the browser and the server shall also listen to the no-cache signal from the browser and release their caches. So it is a good and effective way of knowing you have the latest content in your browser.
If you are using Domino Accelerator Pack it will listen for incoming hard refresh and refresh the server side cache for all requests coming in with a hard refresh header. You can use this to refresh the cache if you have made changes to objects that are in the server cache. By doing a hard refresh on changed content you do not have to reset the entire server cache to push out new content.
Bonus tip: If you want to clear the local cache of your web browser, most modern browsers have agreed on the same short cut: Shift-Ctrl-Del to bring up the "empty cache" dialog. Note that this will not prevent the browser from getting server side cached versions. You still want to use the hard refresh for preventing that.