Snapt Aria Web Accelerator: Purge a Cache Domain
  • 17 Dec 2021
  • 1 Minute to read
  • Dark
    Light

Snapt Aria Web Accelerator: Purge a Cache Domain

  • Dark
    Light

Command-line example for deleting matching content in the Snapt Aria Web Accelerator cache (purge). This is useful for deployment scripts, etc. You will be calling the snaptNginx.purgeCacheString method with the argument array of (string). The change takes immediate effect.

The XmlRpc URL for these requests is http://snapt/api/key/secret/snaptNginx/

Code Example

$string = 'www.snapt.net'; // String to purge

$api = 'snaptNginx'; // Accelerator
$method = 'purgeCacheString'; // method being called

$call = $api . '.' . $method;
$args = $string;
$result = getClient($api)->call($call, $args); // Send your XMLRPC request

This uses the Zend XmlRpc client, with a custom function getClient as seen below -


function getClient($api) {
$client = new Zend_XmlRpc_Client( 'http://' . SERVER . '/api/' . APIKEY . '/' . APISECRET . '/' . $api . '/');
$client->getHttpClient()->setConfig(array('timeout' => 10));
return $client;
}