- Issue created by @eduardo morales alberti
- Merge request !15Issue #3425396: Do not set anonymous session to avoid lost cacheability on redirection β (Open) created by eduardo morales alberti
- last update
about 1 year ago 49 pass - last update
about 1 year ago 49 pass - Status changed to Needs review
about 1 year ago 1:40pm 4 March 2024 - last update
about 1 year ago 49 pass - last update
about 1 year ago 49 pass - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
We changed to a hash in the URL instead of a query param, because in some cases the cache is based on the query params.
- πΊπ¦Ukraine artem_sylchuk Lutsk
That worked perfectly for me, thanks!
- Status changed to RTBC
about 1 year ago 11:40am 7 March 2024 - πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Thank you @artem_sylchuk
- First commit to issue fork.
- π§πͺBelgium dieterholvoet Brussels
Displaying the message using JS seems to work, but:
- I can't reproduce a new session being added to the sessions table when the message is set in Drupal
- When setting the message using JS, responses are still serving
cache-control: must-revalidate, no-cache, private
. That's probably because Drupal forms are uncached. I know that's being worked on β , but for now they aren't cacheable
Having said that, I don't really see the advantage yet of this new approach. Am I missing something?
- π¨π¦Canada b_sharpe
@dieterholvoet I just tested on a fresh D11 and while you are correct the DB entry does not exist (I'm not sure when this changed or is dependent on env setup), the session cookie does exist.
The problem isn't that the form itself is uncached, but that with the session cookie all subsequent requests are uncachable by page cache until that cookie is deleted or expired. For a lot of large sites, this usually means bypassing CDN's as well as extra strain on the server while it serves dynamic page cache to anonymous users that would have otherwise been page cached without the cookie.
Hopefully that clears things up.
- π§πͺBelgium dieterholvoet Brussels
Alright, thanks for the explanation, makes sense. I updated the copy a little bit, seems good now. This does still need tests though.