I have some pages that take long time to render, and I want to use Stale Page Cache (SPC) to make users never (or almost never) wait for their rendering to finish, planning to set a long TTL in SPC.
The documentation says:
Stale Page Caching allows the delivery tier to serve a lot of visitors a stale page while just 1 visitor is waiting for the recreation of the page. After the cached page is ‘refreshed’ with the recreated one, all new visitors will get the fresh page.
Based on the above, my expectation is: when an entry in First Level Page Cache (FLPC) expires, each new request should receive content from SPC until it expires there.
If I set TTL for SPC to ‘eternal’, once the page is cached, I would expect the page to always be served from the cache and never re-rendered.
The actual observed behaviour seems to contradicts my assumption and, in my eyes, the documentation.
After enabling FLPC and SPC, what I see happening is this:
As soon as the page entry in the FLPC expires, the next request for the page triggers rendering and is blocked while the page is being rendered.
Additional requests received while this rendering is in progress are also being blocked and each of them triggers their own rendering.
All this is happening even though SPC contains a valid entry.
Does this sound like a bug in SPC or is it a designed behaviour? Does it sound like I’ve missed something from my configuration, or does it simply means that I misunderstood the documentation?
Based on the logs and debugging of
CompositeHstCache I can see both caches present and used. As long as FLPC contains a valid entry it is served from it as expected.
I’m happy to provide a log that illustrates the above behaviour.