FriendsOfSymfony/FOSHttpCache — pull request #153 by dantleech (2014-12-30 10:53:20+00:00)
Title: [WIP/RFC] Refactored CacheInvalidator into descreet units

- Renamed and repurposed CacheInvalidator => CacheManager
- CacheManager now delegates to handlers
- Added handlers for each use case

Usage:

````php
$cache = new Varnish();
$pathHandler = new PathHandler($cache);
$tagsHandler = new TagsHandler($cache);

$cacheManager = new CacheManager(array(
'path' => $pathHandler,
'tags' => $pathHandler,
));

// invalidate by path
$cacheManager->invalidate('path', '/path/to');

// invalidate by path with headers
$cacheManager->invalidate('path', '/path/to', array(
'headers' => array(
'X-Foo' => 'bar'
)
);

// invalidate tags
$cacheManager->invalidate('tags', array('foo', 'bar'));

// refresh a path
$cacheManager->refresh('path', '/path/to');

// flush -- will flush all the cache implementations used
// by the handlers (once)
$cacheManager->flush();
````

Each handler has its own cache proxy instance. This would allow different cache
implementations to be used simultaneously if required.