Comments (4)
Upon some further investigation, it looks like the headers are present when using the pages/
directory. I forked my example and switched to pages/
directory and now the middleware correctly filters out prefetched pages from the middleware.
https://codesandbox.io/p/devbox/nextjs-missing-prefetch-header-pages-5ckpjs
And this can be confirmed by inspecting the Network request:
So is it safe to assume that this discrepancy between pages/
and app/
router is a bug? Or is that intentional?
from next.js.
missing: [
{ type: 'header', key: 'next-router-prefetch' },
{ type: 'header', key: 'purpose', value: 'prefetch' },
],
is also not working as expected in middleware.ts
in our application using v14.0.3
of Next.js.
This is a big problem for us and we are due to go live soon. We don't want to be running our middleware for every link that is prefetched. We are worried that this could run up the quotas for Edge Middleware functions on Vercel if we receive a lot of traffic.
from next.js.
It is a major blocker for my project as well, can we fix this for app/ router
from next.js.
need this
from next.js.
Related Issues (20)
- Failed To Load SWC binary for win32/x64 HOT 1
- Click the browser forward and back, and getServerSideProps does not re-execute HOT 23
- next.config.ts does not support top-level-await HOT 1
- Failed to load SWC binary for win32/x64
- Custom cache handler with dynamic route + static params always shows 404 page HOT 2
- create-next-app (canary): Import of *.module.scss in Client Component causes `__webpack_require__.n is not a function` crash HOT 5
- Catch-all route also catches static assets
- basePath not creating structure correctly when output set to export HOT 3
- Localized Sitemap Doesn't Work HOT 1
- Localized Sitemap Does Not Work HOT 2
- Cookies set in middleware missing on server actions HOT 4
- basePath not creating structure correctly when output set to export
- [typedRoutes] mdx pages in app router are omitted from the Route type during `next build`
- Failed to load SWC Binary for android-arm64 HOT 1
- r is not a function when wrapping API route with a function HOT 4
- Docs: Incorrect version history for sitemap adding changeFrequency and priority attributes to sitemaps HOT 1
- next.config logging option does not log in runtime edge
- <Link> component make the page refresh new request ?? HOT 3
- Module css is not working with Parallel Route HOT 1
- Pending Promises sent from server to client component crash if they reject without a reason HOT 2
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.