Purge cache programmatically
You can purge the FlyingProxy cache programmatically by sending POST requests to https://api.flyingproxy.com.
All requests require an API_KEY, which you can obtain from the site settings.
Below are the examples using wp_remote_post in WordPress.
Purge by URLs
$urls = ['https://your-site.com/hello-world', 'https://your-site.com/another-world']; wp_remote_post('https://api.flyingproxy.com/purge/urls', [ 'headers' => [ 'Content-Type' => 'application/json', 'x-api-key' => API_KEY, ], 'body' => json_encode(array_values($urls)), ]);
Invalidate cache
wp_remote_post('https://api.flyingproxy.com/purge/invalidate', [ 'headers' => ['x-api-key' => API_KEY], ]);
Purge cache (only HTML pages)
wp_remote_post('https://api.flyingproxy.com/purge/pages', [ 'headers' => ['x-api-key' => API_KEY], ]);
Purge everything
Use with caution! Purging everything will purge cached pages and static files, reducing the cache-hit ratio dramatically.
wp_remote_post('https://api.flyingproxy.com/purge/everything', [ 'headers' => ['x-api-key' => API_KEY], ]);