-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Stabilize custom cache handlers and changing memory size. #57953
Merged
Conversation
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
leerob
requested review from
timneutkens,
ijjk,
shuding,
huozhi,
ztanner,
feedthejim,
a team and
wyattjoh
as code owners
November 2, 2023 18:53
leerob
requested review from
jh3y and
lydiahallie
and removed request for
a team
November 2, 2023 18:53
ijjk
added
area: documentation
created-by: Next.js Docs team
PRs by the Docs team.
type: next
labels
Nov 2, 2023
All broken links are now fixed, thank you! |
Converted this to draft as the file has to be passed through the compiler before marked as stable. |
Tests Passed |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Next Runtimes
Diff detailsDiff for page.jsDiff too large to display Diff for edge-ssr.jsDiff too large to display Diff for server.runtime.prod.jsDiff too large to display |
vagnermaltauro
approved these changes
Nov 3, 2023
leerob
added a commit
that referenced
this pull request
Nov 7, 2023
This PR is a combination of many months of feedback from the community on how to self-host with Next.js. It's became clear talking to many of y'all that there is confusion about if all features are supported when self-hosting, and what implications this has when using third-party providers. The deployment docs now clarify that all features are supported when self-hosting. However, this comes with important notes. First, we're building a standard deployment output, not adapters. We want these docs to ensure that if you follow what's described on this page, you're going to have a good experience with Next.js and will be able to take advantage of all features. Previously, we had to add caveats in here about different providers and their level of support. We are not doing that anymore. Instead, we're providing further details on different features and how they can be configured when self-hosting. These docs have existed in other locations (e.g. the specific API pages in our docs), but I've combined and simplified them here so there's one page you need to read to learn about all of the options. If you self-host Next.js anywhere with a Node.js server, Docker container, or static HTML export, all of the following features will work as expected. Further, we've added other specifics around self-hosting ISR / Data Cache and configuring your caching location, which is important when self-hosting with Kubernetes. Finally, there has been a common feature request to allow runtime environment variables, rather than statically inlining the values during the build. While this was possible with `getServerSideProps` in the Pages Router, if the value needed to be used on the component body, this option didn't work, as it needed to be serialized and forwarded to the component. With the App Router, this problem is solved, since Server Components can render entirely on the server. Thus, when dynamically rendering, you can just use `process.env.MY_VALUE` and it works. I also toned down the Vercel section, because, it was a bit much TBH. Related: #57953 --------- Co-authored-by: Ahmed Abdelbaset <[email protected]> Co-authored-by: Tim Neutkens <[email protected]>
AhmedBaset
reviewed
Nov 20, 2023
vagnermaltauro
approved these changes
Jan 17, 2024
huozhi
approved these changes
Jan 17, 2024
This was referenced Jan 18, 2024
ForsakenHarmony
pushed a commit
that referenced
this pull request
Jan 18, 2024
huozhi
added a commit
that referenced
this pull request
Jan 18, 2024
Follow up for #57953 for DX, give better warnings x-ref: #60828 (comment) Closes NEXT-2156
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR stabilizes the previously introduced experimental config options for providing a custom cache handler (for both ISR as well as the Data Cache) and for disabling or configuring the in-memory cache size. The example usage would be as follows:
This PR also updates the documentation to better reflect how to use the custom cache handler when self-hosting. Further information will be added in a following PR that also includes a full example of a custom cache handler that implements
revalidateTag
as well as passing in custom cache tags. The API reference docs have been updated here, as well as a version history added.I also noticed that we currently have two duplicated versions of the ISR docs in the Pages Router docs: both for rendering and for data fetching. Data Fetching is the correct location for this page. There were no other references to the rendering version in the docs, so that must have been an accident. I'll need to a get a redirect going for that regardless.
Tests have been updated for
cacheHandler
and I added a new test forcacheMaxMemorySize
.