Page Load Ajax Caching Demo

The time shown in the box below is fetched using Ajax when the page is loaded and when the 'Ajax Update' button is clicked:

UK Time:

The Ajax response is set to be cacheable for up to a minute and the time is not updated again within this period even if the 'Ajax Update' button is pressed.

If you try updating this page in IE using F5 (Refresh) or Ctrl+F5 (force refresh) you will find that it doesn't update until the one minute expiration time has expired since the last update.

With Firefox refreshing is possible:

  • If you use F5 (Refresh) in Firefox it issues an If-Modified-Since request and the server will update the time if it is more than 10 secs old.
  • If you use Ctrl+F5 (Refresh) in Firefox it issues an unconditional request and the time value is immediately updated.