Support » Plugin: W3 Total Cache » Page Expiry — can’t seem to change it from 1 hour

  • Hullo. I’ve got a wordpress-based webapp I’m working on. It has a selection of pages which take a very long time to generate (they’re based on external data pulled in via an API). I’ve installed W3 Total Cache in order to cache them. The thing is, I can’t seem to make them stay cached longer than an hour. I couldn’t find a place to set expiration on the “Page Cache” settings page.

    I read somewhere that you can set the expiry period of the Page Cache via the Browser Cache page, so I set my browser cache for HTML/XML to “Set Expired Header” to “86400” seconds. That should let the cached pages stay around for a day right? But I have been testing by hitting a page via Curl every minute and grepping out the W3 Total Cache comment line from the bottom, and I’ve observed that the page is re-generated and re-cached every hour.

    Perhaps there’s some other setting I should be changing? This seems like a really obvious thing one should be able to set and I can’t figure out how to do it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m a bit confused… have you setted the option in the “browser cache” page of w3tc admin area?

    There are two options “Set expires header” to enable and “Expires header lifetime” the lifetime in seconds of the cache.

    Yes, “set expires header” under “general” is checked.

    Under “HTML & XML” I have “set expires header” checked, and “Expires Header Lifetime” set to 86400 seconds (1 day)

    It seems that I do also faced that problem here, and I tried to change garbage collection time, in a few hours I’ll reply with results. In my case the problem is that something influence on page cache and renames files in page_enhanced folder from “html” to “html.old”…

    @ed-fusionary i thin you have found a bug and you need attention of developers.

    You can try to contact official support (isn’t free) or try to open an issue on the community version of w3tc on github:

    Hi @ed-fusionary

    I am having a tough time trying to recreate your problem. From my side, using your settings (and even one that is more aggressive) i am unable to break it (to cause cache files to become .old prematurely).

    Hey if you aren’t afraid of a lil code can you run this small script on site that is having problems (see below). Paste the results here (or give me the link). It will just print out if your side is having problems with key php functions that is needed for caching. If they aren’t available all files are set to “.old” when the garbage collection happens. There is also a link to the current GMT it to compare times — they should match.

    echo "<i>filemtime()</i> is <b>". ( cmd_enabled( 'filemtime' ) ? "AVAILABLE" : "NOT Available" ) . "</b><br />";
    echo "<i>file_exists()</i> is <b>". ( cmd_enabled( 'file_exists' ) ? "AVAILABLE" : "NOT Available" ) . "</b><br />";
    date_default_timezone_set( 'UTC' );
    echo "Current GMT time is: <b>" .date( "M d Y h:i:s" ) . "</b> should match what is shown at: <a href=''></a>";
    function cmd_enabled( $cmd ) {
        $disabled = explode( ',', ini_get( 'disable_functions' ) );
        return !in_array( $cmd, $disabled );


    Thanks, Kimberly! All is well per the script:

    filemtime() is AVAILABLE
    file_exists() is AVAILABLE
    Current GMT time is: Feb 06 2017 01:42:49 should match what is shown at: (it does)

    Maybe you could run down a list of exactly what numbers should be where in the settings to give me a 24 hour expiry time? Maybe I’ve missed something obvious.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page Expiry — can’t seem to change it from 1 hour’ is closed to new replies.