perimeter / cache-bundle
Cache integration for the Memento caching library into Symfony2 and Perimeter API Gateway
Installs: 1 149
Dependents: 0
Suggesters: 1
Security: 0
Stars: 8
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.3
- garyr/memento: ~1.0 || ~1.1
- symfony/symfony: 2.5.*
Requires (Dev)
- phpunit/phpunit: 4.1.3
This package is not auto-updated.
Last update: 2024-12-21 18:29:58 UTC
README
A Symfony Bundle that wraps the memento caching library and provides an extensible interface for integration with the Perimeter API Gateway.
Usage
You can access the memento
caching library using the service container
// get the cache client $memento = $container->get('memento.client');
Or you can use the perimeter caching service, which implements Perimeter\CacheBundle\Cache\CacheServiceInterface
in order to be interchangeable with other caching services.
Prefixes
The perimeter.cache
service also supports cache prefixes, which can be important when deploying to multiple environments:
Production config
<!-- Resources/config/services_prod.xml --> <parameter id="perimeter.cache.prefix">prod</parameter>
Beta config
<!-- Resources/config/services_beta.xml --> <parameter id="perimeter.cache.prefix>">beta</parameter>
This will ensure that if your cache engine is shared across environments (i.e. beta and prod share memcache or redis instances) the caching does not collide.