RSS Feed BLOG

It's all about the cache

POSTED 1st October 09, by Mike Griffiths.

Quite frequently people, including both clients and ourselves, are expecting changes to have been made to a web site, but when we view the web site nothing has changed. This is often not because the change hasn't been made, but because you're viewing an old version of the web site that's stored on your computer, this is known as a cache.

Everytime your browser visits a page, just like this one, the browser will download it from our web servers and store it in a file on your computer somewhere. If you visit the page again within a set period then instead of re-downloading the page from our servers the browser will just load it from your computer. This method makes the pages faster to load and means we use less bandwidth serving you the pages.

Browsers are quite clever through. Normally they work out what content is likely to change more. Static text is quite likely to change often, so that is normally reloaded every time the page is brought up, but the logo images at the top of the page are unlikely to change very frequently, so you may need to clear your cache in order to change this image.

If you want to force your browser to clear its cache and to re-download the page again you can just press ctrl+F5 on Windows or hit cmd+r on Mac.

All of this caching can be controlled at our end too. We often want to make pages as fast to load for users as possible in order to give the best user experience that we can. Our programmers can manipulate the way your browser thinks by prolonging the amount of time between each cache and by telling the browser that the page hasn't changed. In the same way our programmers can also force your browser to refresh in order to display any new content that may have been loaded.

For some larger web sites we also use what is called server-side caching. Let's say we have a web site that has 1 million products, each with 30 colour variations. In the database that would be over 30 million entries, and would be quite slow to search through. We have developed a clever caching system that can save a copy of dynamically generated pages on our server, then the next time the page is requested instead of the server searching through millions upon millions of rows, the one page is simply loaded. The clever part is that the server knows when an item from the page has changed and updates the cache accordingly. This can speed up large web sites dramatically and make sure your users receive the best experience every time.

TAGS: CACHE

  • Chester Zoo
  • Oddfellows
  • Dreamland
  • Perfect Getaways
  • Makro