Add Cache-Control header to allow Vercel to cache the server-side generated HTML.
With this, when a page is cached, subsequent users will get this cached page.
When the cache expires after 10sec, Vercel still returns the cached page if it is less than 50sec expired but also update it in the background (stale-while-revalidate). So when there is at least one loading of the page every 60sec, users should always get a cached version that is max 60sec old.
This cache is only saved when the user is not logged in. But logged in users will get a "public" cache version if one exist. I didn't find a way to disable this. The page is flickering on component that are loading user-specific data.
Description
Add Cache-Control header to allow Vercel to cache the server-side generated HTML.
With this, when a page is cached, subsequent users will get this cached page. When the cache expires after 10sec, Vercel still returns the cached page if it is less than 50sec expired but also update it in the background (
stale-while-revalidate
). So when there is at least one loading of the page every 60sec, users should always get a cached version that is max 60sec old.This cache is only saved when the user is not logged in. But logged in users will get a "public" cache version if one exist. I didn't find a way to disable this. The page is flickering on component that are loading user-specific data.
How to test
Cache-Control
andAge
headers of the first responseChecklist
dev