• I’m using WordPress 3.6 with W3 Total Cache v0.9.3 installed.

    The website I’m working with uses pages exclusively (no posts).

    When an Editor updates a page, it doesn’t refresh the cache automatically, and I’ve had issues with it not updating even after several days (this is with default the 3600s garbage collection interval in place).

    At the moment, I have to “Clear All Caches” after anyone makes updates (Purging the page cache doesn’t work for whatever reason) and this is not something I can effectively handle.

    I was looking into manually clearing the cache after someone makes an edit. I tried adding this in wp-content/themes/<yyy>/functions.php:

    function w3tc_flush_cpt( $post_id ) {
      if( !class_exists( 'W3_Plugin_TotalCacheAdmin' ) ) {
          return;
      }
    
            $plugin_totalcacheadmin = & w3_instance( 'W3_Plugin_TotalCacheAdmin' );
            $plugin_totalcacheadmin->flush_all();
    }
    add_action( 'save_post', 'w3tc_flush_cpt', 10, 1 );
    add_action( 'edit_post', 'w3tc_flush_cpt', 10, 1 );

    But it doesn’t work (when I click “Update” it takes me to a blank screen with URL at “…/post.php” … PHP debugging says it can’t find function flush_all();

    Not sure where to go from here and nothing I’ve seen online has helped. How can I go about troubleshooting and fixing this?

    In case it might be of interest, this is the website: https://www.cbi.tamucc.edu

    https://www.ads-software.com/plugins/w3-total-cache/

  • The topic ‘W3TC not updating pages after updates’ is closed to new replies.