Skip to content

POC of "fake" PPR for data - #4450

Draft
conico974 wants to merge 35 commits into
mainfrom
conico/ppr-experiment
Draft

POC of "fake" PPR for data#4450
conico974 wants to merge 35 commits into
mainfrom
conico/ppr-experiment

Conversation

@conico974

Copy link
Copy Markdown
Contributor

This is really an ISR route, but it is a POC of how we could use this to basically achieve 100% hit rate as long as we prerender some small portions of a website.
This will not be considered a cache hit at the CF/vercel level, but virtually every possible combinations will be covered by the component cache.

If we decide to go this route, we'll need to figure out a better way to pass token data around

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 313e1b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary of the deployments:

Version URL Status
Vercel
Cloudflare

Test content

Site 2v 2c
GitBook /url/gitbook.com/docs /url/gitbook.com/docs
E2E /url/gitbook.gitbook.io/test-gitbook-open /url/gitbook.gitbook.io/test-gitbook-open

@argos-ci

argos-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Awaiting the start of a new Argos build…

@conico974
conico974 force-pushed the conico/ppr-experiment branch from d59c7b6 to 19401a1 Compare August 21, 2026 13:47
conico974 and others added 21 commits August 26, 2026 12:35
…refactor headers handling, and add new layout and page components
…mponents, and update utility functions for visitor tokens
…t handling, and streamline API token management
…: enhance caching logic and add API token handling
…ts to ensure independent revalidation and improve data fetching efficiency
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…RouteParams by removing unnecessary cache path variation
… requirement and update related handling in middleware, tests, and proxy scripts.
`mock.module` replaces a module for the whole bun test process, so mocking
`@/lib/context` and `jwt-decode` wholesale in the PPR route params test broke
every later test file that imported them. Spread the real context module and
sign a real JWT instead.

Also restore the `x-gitbook-route-site` debug header, commented out by mistake.
conico974 and others added 4 commits September 1, 2026 18:17
…ng revalidation tokens for scoped content API tokens, enhancing caching and claims management across components.
`SitePPRLayout` resolved a full site context, which fetches the published
site (site-scoped token) and the space with its revision. Only the site
part is needed to render the shell, and the shell is re-rendered on every
request.

Split `GitBookSiteContext` into a `GitBookSiteScopeContext` holding
everything derived from the published site, and the space context it is
merged with. The PPR layout now resolves only the site scope, under the
header scope so it shares its site fetch, and delegates the announcement,
header, table of contents, footer, admin toolbar and the page/tag icons to
cached components that resolve the revision under their own scope.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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