Title: Cache custom page &#8211; API or php hooks?
Last modified: August 20, 2016

---

# Cache custom page – API or php hooks?

 *  [johnmontfx](https://wordpress.org/support/users/johnmontfx/)
 * (@johnmontfx)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/cache-custom-page-api-or-php-hooks/)
 * 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/](http://wordpress.org/extend/plugins/w3-total-cache/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [johnmontfx](https://wordpress.org/support/users/johnmontfx/)
 * (@johnmontfx)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/cache-custom-page-api-or-php-hooks/#post-3464486)
 * 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.
 *  [exbm](https://wordpress.org/support/users/exbm/)
 * (@exbm)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/cache-custom-page-api-or-php-hooks/#post-3464489)
 * 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.
 *  Thread Starter [johnmontfx](https://wordpress.org/support/users/johnmontfx/)
 * (@johnmontfx)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/cache-custom-page-api-or-php-hooks/#post-3464490)
 * Sweet — that’s a great suggestion.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cache custom page – API or php hooks?’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [johnmontfx](https://wordpress.org/support/users/johnmontfx/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/cache-custom-page-api-or-php-hooks/#post-3464490)
 * Status: not resolved