Pros and Cons for high “expire time” on wp-super-cache or w3-total-cache?

In the wp-super-cache page, there is the following sentence, which I do not understand::

Checking for and deleting expired files is expensive, but it’s
expensive leaving them there too. On a very busy site you should set
the expiry time to 300 seconds.

Read More

Let’s say that I am using a low expiry time, doesn’t that mean that the cache needs to rebuild over and over every 300 seconds?

I mean, most of my content (except for the home page), does not change. So why should I matter if most of the posts will simply stay the same for days?

Related posts

Leave a Reply

2 comments

  1. It’s a great question, and one I’ve been a little confused by as well. The conclusion I’ve drawn is, it’s expensive to leave cache files for two reasons:

    1. If your site (or sites, in the case of a multisite installation) has/have a lot of pages, you can easily end up with thousands of cache files, which makes finding the right cache file a little slower.
    2. It’s easy for updates to be overlooked (e.g. change to a theme file, plugin, widget, etc) and so if you had no garbage collection and required yourself to remember to manually clear the cache, you leave a lot of room for human error.

    As the plugin documents, there’s no “right value” to put in there. If you rarely make changes to your site, and you don’t have thousands of pages, I see no harm in making this value a day or two. Then, at worst, a page is stale for that length of time.

    Again, I’m not saying this is the answer, I’m saying this is what I think is the answer. This question is over 6 months old, so if you’ve found a better answer since asking this, do share!

  2. My experience with w3-total-cache has been that a high expiry time is just fine. This is because when a post is updated, it is purged from the cache. So, I can leave the expiry time at a day or more, and it has no negative affect on my site.

    We also have several pages that are completely dynamic and are not updated themselves. In those cases (like our home page, in particular), I just have it purge that page from the cache on every update.

    This has worked very well for us and helps our load times tremendously.

    Here is a parial screenshot of the page cache config:

    Screenshot