Support » Plugin: W3 Total Cache » Page Cache is stale with no garbage collection

  • Resolved onerock


    I am having an issue with my page cache going stale. I have page cache setup with the following options.

    Page Cache Tab
    Page caching via disk: enhanced
    Garbage collection interval: 3600 seconds

    Browser Cache Tab
    Set expires header Expires header lifetime: 604800 seconds
    Set cache control header Cache Control policy: Cache with Max-age

    When I run my pages through it states that my pages are stale. Below is the information it gives me.

    The resource last changed 10 days 5 hr ago.
    This response allows all caches to store it.
    This response is already stale.
    This response cannot be served by a cache, because it is stale.
    Cache-Control: public is rarely necessary.

    Shouldn’t the pages be “flushed” from the page cache after a certain amount of time? I have a separate script running that regenerates the pages in the cache when they are “flushed”. This should restart the “resource last changed” time/date.

    My question is how do I keep my page cache fresh or am I totally misinformed on how this all works?

    Thanks in advance for any help that is offered!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same problem here – seems like garbage collection is not working 🙁
    Any ideas?

    Through reading other threads and sites on the subject, it seems that garbage collection only runs when a cache miss has happened. I prime my page cache so this never happens on my site which explains the stale cache. I am currently in the middle of trying the following workaround. I use a 7 day expiration so it will be a few days for results.

    I created a page that has no content other than header, footer, and sidebar. I created the simple script below and run it as a cron job once an hour. Logs and headers, so far, show that the cache is missing and being re-created. We’ll see if this works, fingers crossed.

    # Script to attempt to kick start page cache garbage collection

    # Delete cached page from pgcache folder
    rm -rf /www/wp-content/w3tc/pgcache/test-page

    # Call Test Page in hopes that this will trip garbage collection to fire
    rm /root/index.html
    wget -q

    So far, the above solution is holding strong. I have made no changes to several pages and they report in “The resource last changed 2 min 17 sec ago.”

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page Cache is stale with no garbage collection’ is closed to new replies.