open-next icon indicating copy to clipboard operation
open-next copied to clipboard

Feat external cache

Open conico974 opened this issue 7 months ago • 3 comments

This PR allow the ISR/SSG cache to resolve before reaching NextServer. This has 2 big benefits:

  • It reduces cold start because we don't need to load the js for the route for ISR/SSG ( It could have a big impact for path that match multiple route )
  • It allows the cache hit to happen directly inside the external middleware ( This will allow us to make PPR works as intended inside the CDN and not in the server as in standalone mode) This one probably need to be a Minor release as it will require some changes to the IAC ( external middleware will need extra permissions )

It is still WIP :

  • [x] Make it work with external middleware
  • [ ] ~~Maybe implement PPR here ??? (It might be better in a subsequent PR as this might require a lot of changes)~~

Some notes around PPR : We probably want next to settle on an implementation, because as of right now there is no way to do it outside of minimal mode. There is a dirty solution for this, we could have 2 version of NextServer running inside the handler, one in minimalMode for PPR and the normal one for the rest. Maybe they'll decide to allow this for anyone and not only on vercel. ( we just need to have acces to the _next/resume endpoints )

conico974 avatar Jul 24 '24 14:07 conico974