kunstmaan/cache-bundle

The Kunstmaan Cache bundle supplies your project with the ability to ban certain pages from Varnish from within KunstmaanCMS

Installs: 119

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 8

Forks: 0

Type:symfony-bundle


README

Installation

This bundle is compatible with all Symfony 3.* releases. More information about installing can be found in this line by line walkthrough of installing Symfony and all our bundles, please refer to the Getting Started guide and enjoy the full blown experience.

Usage

This bundle allows you to do stuff with caching. For now it's a starting bundle with the possibility to ban stuff from varnish.

Configure bundle in config.yml

This bundle works with the fos http cache bundle. Therefore you need to add the following configuration, of course with your own varnish path.

fos_http_cache:
    proxy_client:
        varnish:
            servers:
                - 127.0.0.1:6081
    cache_manager:
        enabled: true
    invalidation:
        enabled: true

Add the kunstmaan_cache routing to your routing.yml

# KunstmaanCacheBundle
KunstmaanCacheBundle:
    resource: "@KunstmaanCacheBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/
    requirements:
        _locale: "%requiredlocales%"

Result

When you browse to "Settings" in the main menu, you will see that there is a new menu item available with the label of "Varnish ban". There you can add a path that you would like to ban from varnish. When you check the all domains option and you are using a multidomain website, the path will be banned from all hosts of your multidomain.

On nodes you have a new menu actions to clear the cache for that node.