Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to allow an opt-out from AddTagsListener #4327

Closed

Conversation

domgraziano
Copy link

Q A
Branch? main for features
Tickets #3168
License MIT
Doc PR api-platform/docs#...

I noticed that at each request this ApiPlatform\Core\HttpCache\EventListener\AddTagsListener adds Cache-Tags just before returning the response. For large interconnected entities this can have unexpected consequences and it should really be an opt-in listener in my mind. In my case for example I have https://linkerd.io/ limiting infra service communication headers to 12k. On each get because of this listener I have bigger than 12k headers for specific "big" linked resources ... this happens on GET(s) too! For backward compatibility though I added a flag so that by default is turned on but can be turned off easily under http_cache config.

@alanpoulain
Copy link
Member

You can already turn off the invalidation system:

api_platform:
    http_cache:
        invalidation: false

@domgraziano
Copy link
Author

You can already turn off the invalidation system:

api_platform:
    http_cache:
        invalidation: false

thank you! I was aware of that, this is an attempt instead to opt-out from the added cache tags in the response headers, leaving the invalidation enabled without causing bkwrd incompatibility.
Let's say that I want to change the mechanism of how cache tags are stored in the headers (see #3168) sometimes are just too big and I want compress them (for example). So I would not need that subscriber adding all the uris to my headers.

@alanpoulain
Copy link
Member

So you want to keep the Varnish purger but not the Cache-Tags header?
Personally I find it too much fine-grained. Why not removing yourself it in your DependencyInjection?

@domgraziano
Copy link
Author

So you want to keep the Varnish purger but not the Cache-Tags header?
Personally I find it too much fine-grained. Why not removing yourself it in your DependencyInjection?

Ok, I see what you mean ... closing this then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants