This Bundle provides a way to set path based cache expiration headers via the app configuration
1. Add this bundle to your project as a Git submodule:
$ git submodule add git://github.com/liip/CacheControlBundle.git vendor/bundles/Liip/CacheControlBundle
2. Add the Liip namespace to your autoloader:
// app/autoload.php
$loader->registerNamespaces(array(
'Liip' => __DIR__.'/../vendor/bundles',
// your other namespaces
));
3. Add this bundle to your application's kernel:
// application/ApplicationKernel.php
public function registerBundles()
{
return array(
// ...
new Liip\CacheControlBundle\LiipCacheControlBundle(),
// ...
);
}
Simply configure as many paths as needed with the given cache controls:
# app/config.yml
liip_cache_control:
rules:
- { path: /, controls: { public: true, max_age: 15, s_maxage: 30, last_modified: "-1 hour" } }