asm89 / twig-cache-extension

The missing cache extension for Twig. Caching template fragments with Twig.
MIT License
388 stars 27 forks source link

Added BlackholeCacheStrategy for dev/debug-Mode to avoid any caching #29

Closed itinance closed 8 years ago

itinance commented 8 years ago

In Development Mode it could be very annoying sometimes to have to clear the cache files at all when changing some twig and the previous cached version is rendered instead of the modified one.

With this new Strategy one can overwrite the twig_cache-settings in config_dev.yml to avoid any caching: e.g.

services.yml:

    twig.strategy.blackhole:
        class: Asm89\Twig\CacheExtension\CacheStrategy\BlackholeCacheStrategy

config_dev.yml

twig_cache:
    strategy: twig.strategy.blackhole
asm89 commented 8 years ago

@itinance LGTM :+1:

Can you copy the file header from the other files to keep them consistent?

itinance commented 8 years ago

Sure :) Done.

itinance commented 8 years ago

Is there still something wrong with it?

asm89 commented 8 years ago

:+1: Thanks for your contribution. :)