WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] W3TC Page Caching with a static front page (4 posts)

  1. robhenley
    Member
    Posted 1 year ago #

    I ran into an issue today where I wanted to enable page caching but exclude the "front page" from being cached. I unchecked the "Cache home page" but the page was still being cached. After some sleuthing it appears that W3TC 0.9.2.4 doesn't check whether the "home page" is a static front page. I've temporarily fixed this by changing the if in lib/W3/PgCache.php on line 581 to the following:

    if (!$this->_config->get_boolean('pgcache.cache.home') &&
                    ((function_exists('is_home') && is_home()) ||
                    (function_exists('is_front_page') && is_front_page()))) {
                $this->cache_reject_reason = 'Page is home';
    
                return false;
            }

    I'm not sure if this is the best way to do it and definitely don't want to modify the "core" of the plugin so I'm looking for alternate solutions or to find if I've missed something.

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

  2. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, will check.

  3. robhenley
    Member
    Posted 1 year ago #

    Frederick - This was fixed in 0.9.2.6b by adding a separate checkbox and if statement. Thanks anyway!

  4. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    Aha, right @robhenley :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic