WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Cache custom page - API or php hooks? (4 posts)

  1. johnmontfx
    Member
    Posted 1 year ago #

    I've searched, but can't find the exact answer I'm looking for -- or something isn't working for me.

    The basic issue is that I have a WordPress Page which is using a php template to create an XML file for an external app. Unlike much other content on the site, it is actually not customized per user. It is also very db intensive. So I'd like to cache it.

    I have tried to figure out a way to cache only this page, but am flummoxed. In the php file, I've put:

    define('DONOTCACHEPAGE', false);
    define('DONOTCACHEDB', false);

    But this doesn't cache. I thought it might, but no.

    Is there something within this .php script/file that can flag it to be cached. I assume it would be flushed at other page cache flushes.

    Thanks for listening

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

  2. johnmontfx
    Member
    Posted 1 year ago #

    I think I've found some other plugins that will allow me to have granular caching for a particular page, as well as a time/age setting.

    I'd rather not install a new plugin (imho minimizing them minimizes conflicts). I'm curious if anyone had suggestions as to how I might be able to implement this in W3 Total Cache.

  3. exbm
    Member
    Posted 1 year ago #

    If you use disk:basic you can cache any wordpress url in wordpress. I have tested it using custom query_vars and a template_include filter.

    use Disk:basic caching then check:

    Cache URIs with query string variables

    in the page cache config tab.

    You can then use exclude pages you don't want cached with regex in the never catch these pages box on the advanced section.

  4. johnmontfx
    Member
    Posted 1 year ago #

    Sweet -- that's a great suggestion.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic