Skip to content

[HttpKernel] Post request with HttpCache should not invalidate cache #48301

@shyim

Description

@shyim

Description

Currently, all "non-safe methods" (POST) will call invalidate which bypasses the Cache (which is Okay), but calls invalidate also on the Store.

This will lead to unwanted cache invalidation, as any POST on that route clears the cache.

We use in our application an ReverseProxyStore which implements the StoreInterface to forward invalidations to external services like Varnish / Fastly. So we would like to opt out of this magic.

Idea

Add a new option invalidate_on_non_safe-method with true and allow us to disable this

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions