Skip to content

custom ttl should work even without s-maxage #576

@dbu

Description

@dbu

As discussed in sulu/sulu#7441, the CustomTtlListener only gets active if s-maxage is > 0.

https://github.com/symfony/symfony/blob/04f9e6dc07cc228fb3023579c0a63a6ae06a4674/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L408-L410 decides whether to call store at all.

We need the listener to rewrite s-maxage before the store decision happens, so PRE_STORE is too late. the best option i can see is to have events around HttpCache::forward. changing the caching rules in POST_FORWARD should be the right spot to get the response cached. while we are at it, we should also do a PRE_FORWARD to allow users to modify the request before giving it to symfony if they want to.

to validate: does the control flow look the same in older symfony versions?

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