Twig
Twig copied to clipboard
Cache tags don't work in Symfony when @cache.app is TagAware
I wanted to create this issue in the twig-extra-bundle repository, but since issues seem to be disable there I'll create it here.
The problem I encountered is that twig-cache doesn't work in Symfony when @cache.app is TagAware, because the TwigExtraBundle wraps @cache.app with a TagAwareCacheAdapter, so the cache is tag aware twice to say. Which doesn't work at all, and causes every read to be a MISS.
Making @cache.app not TagAware solves the problem, but ideally I didn't want to have to that.
I can see multiple solutions:
- At least document this so people are aware
- Check if
@app.cacheis TagAware and if so behave differently - Allow configuration for what cache should be injected instead of always using
@cache.app