Skip to content

Symfony2 Bundle that provides a way to set path based cache expiration headers via the app configuration

Notifications You must be signed in to change notification settings

snc/CacheControlBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CacheControlBundle

This Bundle provides a way to set path based cache expiration headers via the app configuration

Installation

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(),
          // ...
      );
    }

Configuration

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" } }

About

Symfony2 Bundle that provides a way to set path based cache expiration headers via the app configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%