Skip to content
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

Add Cache-Control header #581

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Add Cache-Control header #581

wants to merge 3 commits into from

Conversation

NicolasMahe
Copy link
Member

@NicolasMahe NicolasMahe commented Feb 21, 2024

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

Checklist

  • Base branch of the PR is dev

@NicolasMahe NicolasMahe self-assigned this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant