-
Notifications
You must be signed in to change notification settings - Fork 27.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Segment Cache] Support output: "export" mode
Adds support for output: "export" mode to the Segment Cache implementation. We output an additional `.txt` data file per segment per page. When the client issues a per-segment request, it appends the segment path to the end of the page URL, rather than passing it as a request header. The segment file output follows this convention: ``` /a/b/c.html /a/b/c/__next.a.txt <- corresponds to segment /a /a/b/c/__next.a.b.txt <- corresponds to segment /a/b /a/b/c/__next.a.b.c.txt <- corresponds to segment /a/b/c ... and so on ``` This scheme is designed so that the server can implement patterns like protection rules or rewrites using just the original path. i.e. by blocking access to `/a/b`, you also block access to all of its associated segment data. Technically it's possible for the segment files to clash with a nested segment config. We add a `__next` prefix to make a clash less likely. It's unlikely this will ever be an issue in practice but if needed we could make this prefix configurable at build time.
- Loading branch information
Showing
12 changed files
with
556 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.