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

custom ttl should work even without s-maxage #576

Open
dbu opened this issue Jul 23, 2024 · 0 comments
Open

custom ttl should work even without s-maxage #576

dbu opened this issue Jul 23, 2024 · 0 comments

Comments

@dbu
Copy link
Contributor

dbu commented Jul 23, 2024

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?

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

No branches or pull requests

1 participant