perimeter/cache-bundle

Cache integration for the Memento caching library into Symfony2 and Perimeter API Gateway

v0.1.1 2017-10-09 20:09 UTC

This package is not auto-updated.

Last update: 2024-04-13 14:45:08 UTC


README

Build Status

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.