Created
July 30, 2012 09:21
-
-
Save ivoba/3205828 to your computer and use it in GitHub Desktop.
Symfony2 caching with LiipDoctrineCacheBundle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
liip_doctrine_cache: | |
namespaces: | |
mynamespace: | |
namespace: mynamespace.cache | |
type: php_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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