Title: exclude a specific php file for caching
Last modified: October 15, 2020

---

# exclude a specific php file for caching

 *  Resolved [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/)
 * I have a PHP file where located in /wp-content/themes/theme_name/downloadbox.
   php
    I want to exclude it for caching how can I do it?

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13540883)
 * Hi,
 * ![](https://i0.wp.com/www.litespeedshare.net/2020/10/52c107-ScreenShot2020-10-
   16_01.44.42.png?ssl=1)
 * but you may want to exclude the actual front-end request URI instead of file 
   name
 * Best regards,
 *  Thread Starter [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13547564)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/) Actually in some pages we
   have a section tag. It is displayed when a if condition returns true.
    Condition
   is about user’s country. For example if user’s country is U.S.A, the tag will
   be displayed. The problem is sometime the pages became cache. So the if condition
   does not work. I want to found out a way to stop caching the php file which the
   if function located there.
    -  This reply was modified 5 years, 6 months ago by [RezaY](https://wordpress.org/support/users/mohammad983/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13549896)
 * Hi,
 * So you actually want to “vary” the cache based on user’s location/country ,instead
   of disabling cache ?
 * Best regards,
 *  Thread Starter [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13551587)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/)
    Hi Actually, both way can
   be useful. each one has some advantages for my situation. especially if I can
   disable cache for the PHP file( the function that displays a section tag)
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13553280)
 * Hi,
 * You can not uncache a file , but only URI
 * you can put URI into no-cache list
 * if this page works with cookie , you can use cookie to vary the cache
 * Best regards,
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13599276)
 * Hi,
 * I’m going to mark this topic “Resolved”, due to lack of activity.
 * If you still need help, please feel free to re-open it.
 * Best regards,

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

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

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

 * 6 replies
 * 2 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/exclude-a-specific-php-file-for-caching/#post-13599276)
 * Status: resolved