Unverified Commit 9dc96c89 authored by Bernd Strehl's avatar Bernd Strehl Committed by GitHub

Remove redundant example code for cacheLife docs (#86043)

Remove redundant example code for overriding cache profiles.

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR. ✅ (no changes)
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide ✅

### What?

Remove a redundant example in the `cacheLife` docs.

### Why?

Because the redundant example is confusing.

### How?

Closes NEXT-
Fixes #

-->
parent ef051ff3
...@@ -191,6 +191,7 @@ The example below shows how to override the default `"days"` cache profile: ...@@ -191,6 +191,7 @@ The example below shows how to override the default `"days"` cache profile:
const nextConfig = { const nextConfig = {
cacheComponents: true, cacheComponents: true,
cacheLife: { cacheLife: {
// Override the 'days' profile
days: { days: {
stale: 3600, // 1 hour stale: 3600, // 1 hour
revalidate: 900, // 15 minutes revalidate: 900, // 15 minutes
...@@ -202,22 +203,6 @@ const nextConfig = { ...@@ -202,22 +203,6 @@ const nextConfig = {
export default nextConfig export default nextConfig
``` ```
You can also override the preset profiles by using the same name:
```ts filename="next.config.ts"
const nextConfig = {
cacheComponents: true,
cacheLife: {
// Override the 'days' profile
days: {
stale: 3600, // 1 hour
revalidate: 900, // 15 minutes
expire: 86400, // 1 day
},
},
}
```
### Inline cache profiles ### Inline cache profiles
For one-off cases, pass a profile object directly to `cacheLife`: For one-off cases, pass a profile object directly to `cacheLife`:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment