Enabling Cache In Drupal Can Cause Confusing Side-Effects

I recently enabled caching in a Drupal site and could notice improvement in page-loading performance. Drupal can be compute-intensive, so a cache goes a long way in making your site more responsive to visitors.

There are a few options to choose from when you enable cache. One of them is the 'Minimum cache lifetime.' This defaults to '' and I think it does so for a good reason. With this setting, any time you post a content, all cached pages that are affect by that post expire immediately, so you can the effect of the post right away.

However, for sites which get a lot of traffic, it may be sometimes preferable to set the lifetime to a few hours or even a day, if you don't care about your new post not being seen on your site immediately. I had set the cache lifetime to something like a day, and soon forgot about it.

A couple of days later, as I was creating some new book posts, I found that they were visible to me only when I was logged on, and would disappear when I logged out. In other words, anonymous visitors were not able to see my new book posts. After some investigation, I figured that this was because of the cache lifetime. I set it to '' and the problem went away!

Widget_logo

Who's new

  • editor

Who's online

There are currently 0 users and 0 guests online.

User login