Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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