Comments (2)
Use only-cache
:-
This option sets 'force-cache' if no option is provided on fetch() request.
Where as default-cache sets 'force-cache' if no option is provided on fetch() request but it consider as static even after dynamic functions.
Use following in next-canary only (this creates dynamic rendering with cached data)
export const fetchCache = "only-cache";
Don't need to use fetchCache option in Next 14 because fetch() cached by default, use of dynamic functions will render dynamically.
from next.js.
@ShubhamOulkar Thanks, but I'm not sure if I understand correctly. So what I want is that all requests (also those after dynamic functions) are always cached (unless they specifically opt out using no-store), but that the cache is invalidated every 5 minutes. How would I do that in Next 14?
Note that I do use cookies/sessions/auth, so the functions are always rendered dynamically, but I do want the requests to be cached for 5 minutes.
What do you mean with the "but it consider as static even after dynamic functions." part?
from next.js.
Related Issues (20)
- Server Actions that are hybrid types are compiled to `{}` causing `TypeError`
- Rechart breaks in Nextjs 15-rc.0 HOT 1
- Error boundaries ignored in Production with `dynamicParams = true` HOT 1
- Build fails when object keys contain Japanese middle dots(・) in v14.2
- Latest starter-example project is containing invalid package references. HOT 2
- Impossible to use worker_thread (server side) due to wrong path
- Unexpected Caching Behavior with revalidate in Next.js
- Nested intercepted routes fail
- Draft Mode does not work in Middleware
- Route group as a root of dynamic route shows 404 HOT 1
- Build issue with subpath imports of internal "compiled" package
- OOMKill is hidden during docker-based next build, build appears successful but isn't. HOT 3
- Generating static pages (0/6) [= ]G [AggregateError]
- RSC Fetch Logging deduplicates requests if they share the same URL, even if POST bodies are different HOT 2
- ### Goals HOT 1
- expect is not defined when running next.js with Jest
- Css and JS file not work when I deploy nextjs to vercel, I don't know what happened? HOT 2
- Issue compiling server component as prop in child component HOT 1
- Too much boilerplate, some people don't like it including me HOT 1
- template.tsx is rendered twice, when using Parallel Routes modal and reload.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next.js.