Comments (5)
Hi -- the behavior you're observing relates to the client router cache.
If you'd like to disable the client router cache so that every request hits the server, you can disable it by modifying your next.config.js
as follows:
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
staleTimes: {
dynamic: 0,
},
},
}
module.exports = nextConfig
You can learn more about this configuration option here.
from next.js.
Btw, it can be a pain with Auth. Using the next/prev btns can lead to still display a cached protected page after logout.
from next.js.
Member
thats cool, i will try it
from next.js.
Hi -- the behavior you're observing relates to the client router cache.
If you'd like to disable the client router cache so that every request hits the server, you can disable it by modifying your
next.config.js
as follows:/** @type {import('next').NextConfig} */ const nextConfig = { experimental: { staleTimes: { dynamic: 0, }, }, } module.exports = nextConfigYou can learn more about this configuration option here.
Already saw this, but it didn't resolve all my issues related to this "Lazy" middleware behavior. :/
Also, I tried to invalidate the client router cache, using a router.refresh
call, which still didn't seem to fix my issue.
Maybe I will open an issue for that. /shrug
from next.js.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
from next.js.
Related Issues (20)
- Next/font does not work with Turbopack in a containerized development environment
- Each child in a list should have a unique "key" prop. No way to find the reason for it. HOT 1
- Docs(@next/eslint-plugin-next): not existing `.md` file for rule `no-typos`
- The RSC payload includes server data from all segments, including those from shared layout HOT 2
- Docs: Update Nextjs template for supabase HOT 1
- Next.js prod build logs errors twice HOT 4
- Next.js does not understand TypeScript project references
- Suspense always suspend HOT 4
- next/link has a incorrect prefetch, even though set the <Link prefeth={false} target="_selft" href="https://samedomain.com/path-b" /> HOT 2
- Hi @yaba101! With route interception, any soft navigation that matches the intercepted route will trigger the interception. However, you can make use of route groups with different layouts to have finer control over which layout renders the interception modal + page, versus just rendering the page, without changing your URL structure. You can learn a bit more about route groups [here](https://nextjs.org/docs/app/building-your-application/routing/route-groups). HOT 1
- Modal not closing after opening new page HOT 1
- Client components make bundle size huge
- Cannot read property 'startTime' of null on Android 9 with Chrome 74 HOT 1
- Cannot read property 'startTime' of null on Android 9 with Chrome 74 HOT 1
- Cannot read property 'startTime' of null on Android 9 with Chrome 74 HOT 1
- `useSearchParams` requires Suspense wrapper even when not exporting a component HOT 2
- It wont load i cant deploy websites or import them from github HOT 2
- Redirect in page.tsx shows a white page on client-side navigation
- Weird Server Actions bug when naming a path for a file HOT 1
- next.js 15 after() can not get response.body
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.