Coder Social home page Coder Social logo

Comments (4)

lucasmotta avatar lucasmotta commented on August 11, 2024 2

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:
CleanShot 2024-03-26 at 14 40 28@2x

So is it safe to assume that this discrepancy between pages/ and app/ router is a bug? Or is that intentional?

from next.js.

lmac-1 avatar lmac-1 commented on August 11, 2024 2
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.

akshit-mdr avatar akshit-mdr commented on August 11, 2024

It is a major blocker for my project as well, can we fix this for app/ router

from next.js.

juliansommer avatar juliansommer commented on August 11, 2024

need this

from next.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.