You are here

All About Caches

To clear the cache, choose "Flush all caches" from the little house menu. Ignore the submenu.
Like any advanced website, our websites have caches.  Caches make the site much faster for visitors, which is a key point.  Fast website, happy site visitors.  

Cache Basics

With caches on, the typical page on our website is delivered in about 400 milliseconds (0.4 second), and the home page, which is the most complex, takes about 1.4 seconds.  Without cache, the typical page takes maybe 3 seconds and the home page maybe 6 or 7 seconds.  That’s a long time.
 
Here’s how to think about caches:
 
Without Cache
Visitor:  “I want a peanut butter and banana sandwich.”  
Webserver:  "I will go to the store and get peanut butter.  Then I will go to the store again and get bananas.  Then I will go to the store again and get bread.  Then I will make your sandwich.”
 
With Cache
Visitor:  “I want a peanut butter and banana sandwich.”
Webserver:  “I figured you would want that.  I already made one.  Here’s your sandwich.”
 
You can see how caching speeds up service to our website visitors.
 
However from the content creator’s perspective, with cache:  
You, the content creator:  “I have updated my page.  I now want a peanut butter, banana and kosher dill pickle sandwich.”
Webserver:  "I am serving pre-made peanut butter and banana sandwiches.  Here’s one.  I will go to the store later and get kosher dills.  Ask me again after that.”
You:  “Grrrr."

Clearing the Cache

Drupal 7 has the ability for non-system-administrators to clear the cache.  (Contact Scotty for this permission if you don't currently have it.)  If you have the ability to clear the cache, our story above changes. Picking up from "Grrrr":

You:  “Grrrr."
...
You:  “Hey wait a minute…” [clears cache]
Webserver:  [long pause] “I went to the store and got pickles.  I am now serving pre-made peanut butter, banana and kosher dill sandwiches. Here’s one."

Think Before You Cache-clear

The site has these caches:
— page cache:  a pre-built copy of every end page (a single event, a single news story).  The server decides when to rebuild this, it is not set-able.
— block cache:  a pre-built copy of every menu, logo and such.  Server decides.
— views cache:  pre-built copies of every list page (“all upcoming events,” “featured faculty”), including the home page.  These are currently set to last an hour.
 
So keep in mind, emptying the cache shows your new content sooner, but it throws away all that pre-built, cached content, and slows the site down for all visitors as the caches are rebuilt.  Therefore, use that ability judiciously.  Consider using the “Preview” button to see your new content, instead of clearing the cache.