Performance settings: Cache pages for anonymous users

One of Drupal's settings for performance is: “Cache pages for anonymous users.” This setting is turned on by default for SCLS-hosted Drupal sites.

What it does

When “Cache pages for anonymous users” is turned on for a site, when a visitor requests a page, Drupal will cache the HTML for that page and quickly serve the cached copy to later visitors. Logged-in users (such as library staff editing the website) would not get the cached copies; it would be anonymous, not-logged-in, visitors receiving the cached pages. When Cron runs the cached copies are deleted, and the cache begins to rebuild as new pages are requested.

A silly example

In other words, imagine your website is a kitchen. Someone comes home and says, “Let’s have pot roast.” So you cook a pot roast from scratch, serve it, and put the leftovers in the refrigerator. Later, more people come home and say, “Let’s have pot roast.” Since the pot roast is all made up in the fridge, you quickly serve up pot roast for them. The fridge gets cleaned on a schedule so that nothing gets too old, and the cycle starts again.

The pot roast is a page on your website; the refrigerator is Drupal’s page cache. Getting leftover pot roast out of the fridge is faster than cooking a new one from scratch.

Benefits and drawbacks

Page caching is generally considered safe and recommended. Cached pages should load faster for patrons than un-cached. A possible downside to page caching is occasional, temporary delays between what you see on your site as a logged-in user and as an anonymous visitor.