Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created July 30, 2012 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivoba/3205828 to your computer and use it in GitHub Desktop.
Save ivoba/3205828 to your computer and use it in GitHub Desktop.
Symfony2 caching with LiipDoctrineCacheBundle
liip_doctrine_cache:
namespaces:
mynamespace:
namespace: mynamespace.cache
type: php_file
$cache = $container->get('liip_doctrine_cache.ns.[mynamespace]');
if (false === ($cached_data = $cache->fetch($cache_key))) {
$cached_data = $SOMEAPI->getData($params);
$cache->save($cache_key, $cached_data, 3600);//TTL 1h
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment