New Cache implementation#31
Draft
conico974 wants to merge 11 commits into
Draft
Conversation
Expose RESTful routes (GET/PUT/DELETE /cache/*, POST /cache/revalidate-tags) for remote cache operations, backed by the pluggable IncrementalCache, TagCache, and CDNInvalidationHandler interfaces. Guarded by disableIncrementalCache config option.
The cache adapter GET response now encodes metadata into x-opennext-cache-*
headers and only the relevant payload in the response body. Adds
parseCacheGetResponse helper to reconstruct the cache value on the client side.
- Not-found entries return 404 with x-opennext-cache-found: false header
- Composable, fetch, and route entries return body as text/plain
- Page, app, and redirect entries return structured JSON body
- Individual data/meta headers are split into x-opennext-cache-header-{name}
…deOptions, delegate to cache override Move tag revalidation logic (hasBeenRevalidated, writeTags, CDN invalidation) from the Next.js Cache class into the cache handler (cache-adapter.ts). The cache override now handles all tag operations transparently in get/set/revalidateTags. Update cache.ts, composable-cache.ts, and cacheInterceptor.ts to use globalThis.cache.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
… and local cache methods Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Move the cache into a separate function/service that can be deployed separately.
This separate cache service will become responsible for handling anything cache related (i.e. checking the tag cache and incremental cache)
This cache service can also be called locally as if it was a function for cases where we don't want to deploy the cache as a separate service.
TODO: