asm89 / twig-cache-extension

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

allow annotations to be expressions #12

Closed pourquoi closed 10 years ago

pourquoi commented 10 years ago

Hi there, the main goal of this PR is to allow fine tuning cache lifetimes for generated keys:

{% cache 'v1/' ~ some_object.key 100 %} ... {% endcache %}

{% cache 'v2/' ~ some_object.key 120 %} ... {% endcache %}

instead of using multiple generational cache strategy with different litfetimes we now use one lifetime strategy with generated key

asm89 commented 10 years ago

@pourquoi Thank you for the PR! I added some docs and merged it here: https://github.com/asm89/twig-cache-extension/commit/78ed37609ae9e0a97518e06b2cd1688cecd25e5c.