Skip to content

Cache tags don't work in Symfony when @cache.app is TagAware #3869

@rpkamp

Description

@rpkamp

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:

  1. At least document this so people are aware
  2. Check if @app.cache is TagAware and if so behave differently
  3. Allow configuration for what cache should be injected instead of always using @cache.app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy