###Cache Clearance

In order to clear the cache programmatically, use the `Buster` class included with this repo. The class provides a couple of public methods for clearing the cache in common scenarios, and one method for all other scenarios. You must provide creds for Amazon SQS in order to uses this class.

An example setup:

```php
//require the composer autoload, if necessary. Path may vary depending on your codebase.
require_once '/vendor/autoload.php';

//set up your config. depending on your codebase, these options may come from a config file.
//replace with appropriate values
$config = new \stdClass();
$config->accessKeyId ='{keyId}';
$config->secretAccessKey ='{accessKey}';
$config->region ='{region}';
$config->QueueUrl ='{url}/'; //include a trailing slash
$config->QueueName = ''; //'clear_cache_prod' for production, 'clear_cache_dev' for dev

//Instantiate the class
$buster = new \Buster($config);
$buster->clearAccounting(17194); //clears accounting for vendor id 17194
```

That's it. All `clear` methods and the `send` method will return a [Guzzle model object representing the message details](http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.Sqs.SqsClient.html#_sendMessage). After a message is sent to the queue, a NodeJS listener will pick up the message and delete the appropriate keys. This operation should happen in seconds, at most.

Available public methods:

* `Buster::clearAccounting(int $vendorId)`: Clear accounting cache entries for a vendor.
* `Buster::clearAnalytics(int $vendorId)`: Clear analytics cache entries for a vendor.
* `Buster::send(int $vendorId, array $tags)`: Clear tags (array) for a vendorId (int)

####What this class does not do

* Currently there is no functionality for subaccount IDs. Coming soon.
* There is also no functionality for deleting accounting cache entries for specific periods. They will all be deleted for a specific vendor only. Maybe period-specific deletion is coming soon, though probably not.