WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] Page Cache is stale with no garbage collection (4 posts)

  1. onerock
    Member
    Posted 1 year ago #

    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 REDbot.org 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!

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. b0rman
    Member
    Posted 1 year ago #

    Same problem here - seems like garbage collection is not working :(
    Any ideas?

  3. onerock
    Member
    Posted 1 year ago #

    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.

    #!/bin/bash
    #
    # 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 MyDomain.com/test-page/

  4. onerock
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.