-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[3.4] ESI http_cache seems not written to cache folder anymore #27685
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
Comments
Can you provide a working reproducer, e.g. a repo we could clone and run? |
Tried to reproduce it on a clean installation, and it seems to work on 3.4.11 also. So probably it's something application specific.. might become hard to figure out what that exactly is. Will try to upgrade 3.4.2 -> 3.4.3 etc. to see where my issue gets introduced. |
Request to http://app.local/app_dev_performance.php. Then:
Again a request to http://app.local/app_dev_performance.php. Then:
|
Narrowed it down to a change in Symfony v3.4.3, if I revert the change from this PR: https://github.com/symfony/symfony/pull/25583/files I get to:
|
It makes sense that the clean installation didn't produce me this result, as in there no sessions are involved. In this project each page has a session (cart) available, although the chunks I'm loading are generated independent from sessions - but as it's using the framework I think it still has sessions involved. |
So, that's on you then, and the previous behavior was dangerous, as personal state could leak in the cached fragments! |
Yeah, good one. But, what about backporting this PR to 3.4? https://github.com/symfony/symfony/pull/26681/files. Seems to me like a proper solution in which I can define from the code context when to cache, defaulting to no cache when a session is involved. |
Because that's a new feature. If you really want to cache a session-enabled fragment, think twice, then register a late listener to mimic what this PR will provide? |
Or you can just decorate the listener to disable setting the response to private, similar to what FOS HTTP Cache bundle ia doing: FriendsOfSymfony/FOSHttpCacheBundle#435 |
Thanks @nicolas-grekas & @emodric :) Found a solution that works for now, and working on improving it for the future! |
Symfony version(s) affected: 3.4.11 / 3.4.x-dev
Description
Today I upgraded 3.4.2 to 3.4.11 and the site went into degraded performance on production. It seems after local debugging that the ESI HTTP Cache is not being written (which I didn't test locally before deployment). Local testing with the setup as described below.
Rendering done using
render_esi
. On 3.4.2, thevar/cache/dev_performance/http_cache
folder gets populated with folders & files. On 3.4.11 this does not happen (it stays empty).I just installed 3.4.x-dev to verify it in there, and it also does not work:
How to reproduce
Initially I thought this PR might fix it (#27467), but that one should be included in the commit I'm testing I think.
The text was updated successfully, but these errors were encountered: