About Caching and Site Edits

The UMW web server is now equipped with functionality referred to as “caching.” Caching is when a server holds a copy of visited webpages in memory. Every time someone now visits a page on the UMW Web site, the server will keep a ready copy of it. That copy will last for 30 minutes, after which, the next visit to the page will recreate a new cached version. So, theoretically, every 30 minutes the page will load a little slower (by fractions of a second), but the overwhelming majority of page loads will be much faster.

Once a page is cached, the next person who visits that page won’t even hit the original site, or database, or files in the root directory at all. Instead, they will load that handy “cached” copy of the page. This is a lot less work for the server to do, so it’s much faster. Great, right? Well, site administrators will need to adjust to the effects of caching on viewing some types of edits.

Caching and Content Edits

When you edit the contents of a page or post, WordPress will “purge” the cache of the previous copy. A new cached version of the page will be created as soon as someone who is not logged into the system hits the page. That means that if you visit the page after you make the edit, it doesn’t create a new cached copy. You need to be an anonymous visitor to the site for the caching to work.

I like to cheat on this one: I keep another browser open (say, if I’m working in Chrome, I open Firefox) and go to the page to cache it in the other browser, where I’m not logged in. That ensures that the performance of my page will be optimized for the next visitor. Sneaky, eh? Of course, this can become a compulsion 🙂

Caching and Widgets

Data about widgets does NOT get purged by WordPress. This means that, from the time you delete, add, or move a widget, there will be a delay of an average of 15 minutes before you see the change. It can be up to 30 minutes, but 15 is the predictable average, and it could even be quicker.

Caching and Primary Links

The other thing that won’t change immediately are your automatic sidenav links. If you delete a page, it will remain in your side navigation until the cache expires. As with widgets, this will be an average of 15 minutes, never more than 30, sometimes less. Until the link goes away, it will return a 404 error. However, the likelihood of any one link being hit many times within a 15 minute period is pretty slim.

Caching and Posts

If you create a new post, it will show up immediately in its own page, in an archive page, and in your RSS feed.

Below is a summary of how caching will affect your edits:

Nature of Edit Immediate Update Up to 30 minutes to update
Page or post content edit X
Widget additions/deletions or movement X
Side Navigation after page is added or deleted X
RSS Feeds from your site X
Cross-Site Featured Posts Widget Content X
Genesis Featured Posts Widget Content X
Other Widget Content X

So what does this mean?

The upshot is as follows:

  1. Emergency Changes: If you are in an emergency and a message absolutely, positively has to get out NOW, create a POST, not a PAGE. Remember pages are not for timely information, but enduring information that has a relatively permanent shelf life. Using the Genesis Featured Posts widget on your home page is a great way to keep fresh announcements on your home page. The College of Education is the star pupil on this one (http://education.umw.edu). And the Departments of Art and Art History, History and American Studies, and Historic Preservation use their latest posts AS their home pages. All great ways to ensure that the latest news is always there.
  2. Widgets Require Planning: Don’t go moving, deleting and adding widgets during high-traffic times like registration and expect everyone to see the changes immediately. This makes a new widget a not-so-viable vehicle for an emergency announcement. If you are coming up on a high-traffic time, plan ahead to make sure that your widgets are in place beforehand.
  3. Be patient with the sidenav change: Your sidenav is very important to you, but on a day-to-day basis, it’s not visited nearly so frequently as you think. Be patient waiting for the deleted or added page to show up correctly. Again, adding and deleting pages frantically during high-traffic times is probably not a good idea. Make those major navigational edits in the off-times to ensure that large numbers of people aren’t hitting a moving target 🙂