Title: Purge cache from php script
Last modified: July 19, 2017

---

# Purge cache from php script

 *  Resolved [ntoum](https://wordpress.org/support/users/ntoum/)
 * (@ntoum)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/)
 * Hello,
 * I am using a php script to update prices and stock for woocommerce eshop.
    My
   issue, is that i have to Purge the litespeed cache manually, so the changes to
   be affected for the visitors of the site.
 * Can i call a method to purge the cache from my php file? Or any other way to 
   do it?
 * Thanks in advantage,

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

 *  Plugin Support [Hai Zheng⚡](https://wordpress.org/support/users/hailite/)
 * (@hailite)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9333058)
 * Hi [@ntoum](https://wordpress.org/support/users/ntoum/),
 * Yes you can, if you want to purge a single page, you can use `LiteSpeed_Cache::
   get_instance()->purge_all()` to purge all, or `LiteSpeed_Cache::get_instance()-
   >purge_single_post($post_id)` to purge one post in v1.1.2.2.
 * Please note, in v1.1.3, we will change the structure and add a new API class,
   at that time, you can use a easier and simpler way to do this.
 *  Plugin Support [Hai Zheng⚡](https://wordpress.org/support/users/hailite/)
 * (@hailite)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9333098)
 * If your script is not loaded from WP, you can follow this wiki: [https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:developer_guide:response_headers](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:developer_guide:response_headers)
 * send the purge header manually to server directly.
 *  Thread Starter [ntoum](https://wordpress.org/support/users/ntoum/)
 * (@ntoum)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9335801)
 * Hello,
 * Thank you very much for your answer! I tried it, and seems to working. If i will
   have any problem, i’ll write it here.
 * By the way, is there any documantion with all php methods that i can use? My 
   script is loaded from WP (actually calling wp-load.php).
 *  Plugin Support [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * (@lclarke)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9336838)
 * Hi, [@ntoum](https://wordpress.org/support/users/ntoum/)
 * We do have this wiki that may help, but it’s slightly out-of-date, and is very
   likely to be changing with the next release. You can take a look for reference,
   but I’d hold off doing any major development with it until we get it freshly-
   updated (should be soon!):
 * [https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api)
 * Hope this helps!
    Lisa @ LiteSpeed
 *  Thread Starter [ntoum](https://wordpress.org/support/users/ntoum/)
 * (@ntoum)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9336875)
 * Hello,
 * Nice!! Okey, i will use only the method above, because i am updating daily a 
   lot of products through script, and i am waiting for your update for further 
   major development.
 * Thank you very much for your help!!
 *  Plugin Support [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * (@lclarke)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9336891)
 * Our pleasure. Happy caching!

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

The topic ‘Purge cache from php script’ 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/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [Purge](https://wordpress.org/support/topic-tag/purge/)

 * 6 replies
 * 3 participants
 * Last reply from: [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/purge-cache-from-php-script/#post-9336891)
 * Status: resolved