What is this thing called "cache"? Print

  • 0

The term "cache" may be a little confusing, so here's an attempt to explain it...

Let's pretend that all there is is a single image on a page in a WordPress website.  When you visit, WordPress has to build your page from nothing (known as dynamically) and then your browser downloads all the code plus the image and displays it.  Yay!  The internet works.
 
Next time you go to that page, it is in everyone's interests to save time and resources, so the content of the page, including the image, may have been stored in a bucket of previously viewed content (the cache) at either the server or in your browser.  This time when you go to the page your browser checks "do I already have that page in the cache on Kahdi's device?"  Yes:  simply show it without having to download it again saving time and bandwidth.  No:  Retrieve it from the server.
 
Good so far?
 
let's say it isn't in the browser cache.  Your browser hits the site and says "gimme that page content including the image" and the 123host server does the same thing "is that page in a cache?  If so provide that from the bucket instead of building the page first".
 
But...a server may not cache pages, so we go to the next level and in WordPress we add a caching plugin.  
 
WTF? No server cache? Browser hits wordpress and says (more politely this time) "May I please have that page" and WordPress does the same thing "Is it in a cache? " etc.
 
This all happens really fast.  I don't want to, but I am going to complicate it by adding that your ISP (iinet?  Big Pond? whoever) may have a cache as well which means you don't even get to the server, saving even more time.
 
As a rule, caches have a limited Time To Live (did you ever wonder what TTL stands for?) and will usually expire after an hour or a day or whatever, the bucket is emptied and refilled when someone visits.  That stops you getting out of date content.
 
So...sometimes if, you can't see updates to your own site, or something weird is happening it is a good idea to delete the cache in your browser and your site.

Was this answer helpful?

« Back