Title: exclude a .php file from caching
Last modified: December 28, 2016

---

# exclude a .php file from caching

 *  Resolved [dos659](https://wordpress.org/support/users/dos659/)
 * (@dos659)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/exclude-a-php-file-from-caching/)
 * hi, im loading a specific .php file inside my products pages. Is it possible 
   to exclude that particular file from caching?
 * This .php file contains prices that are updating regularly and instead of clearing
   the cache all the time i want to exclude only this so the customers will always
   see the up to date price.
 * thanks.

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

 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/exclude-a-php-file-from-caching/#post-8597356)
 * [@dos659](https://wordpress.org/support/users/dos659/) Comet Cache is a WordPress
   plugin designed to cache WordPress Posts/Pages. If you have custom PHP code that
   you’re including inside a WordPress Post/Page, and you need to prevent that from
   being cached, you should simply exclude the URI where that PHP code is being 
   included (e.g., add `/prices/` to **Comet Cache → Plugin Options → URI Exclusion
   Patterns**).
 *  Thread Starter [dos659](https://wordpress.org/support/users/dos659/)
 * (@dos659)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/exclude-a-php-file-from-caching/#post-8600009)
 * So if my file is xxx.php is inside wp-content i exclude this URI:
 * [http://www.example.com/wp-content/xxx.php](http://www.example.com/wp-content/xxx.php)
 * is that correct?
 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/exclude-a-php-file-from-caching/#post-8601188)
 * [@dos659](https://wordpress.org/support/users/dos659/) Comet Cache is a WordPress
   plugin that loads when WordPress is loaded. It doesn’t know about `/wp-content/
   xxx.php`, so it won’t be able to exclude that.
 * If you’re doing something like `<?php include(WP_CONTENT_DIR.'/xxx.php'); ?>`
   inside a WordPress Page that has a permalink of [http://www.example.com/sample-page/](http://www.example.com/sample-page/),
   then you would need to add `/sample-page/` to the Comet Cache URI Exclusion Patterns
   to prevent `/sample-page/` (and therefore your `xxx.php` code) from being cached.

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

The topic ‘exclude a .php file from caching’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/exclude-a-php-file-from-caching/#post-8601188)
 * Status: resolved