Replies: 2 comments 1 reply
-
Let me know if this helps! |
Beta Was this translation helpful? Give feedback.
-
I don't know if he's talking about exactly the same thing, but I agree with @mastoj's post. In fact, if I understand correctly, for routes that contain dynamic parameters: either they are completely dynamic (generated with each request), or they are pre-rendered in the build if you use generateStaticParams (and revalidated if necessary). But it would be nice to have a mix of the two. And then they would have the normal lifecycle of static pages: it's always the cached page that's served. And it can be revalidated (either via the tags or via the pathname). I thought it worked like that but I was surprised to see that it didn't. Is this by design? How can I implement the behaviour I've described? |
Beta Was this translation helpful? Give feedback.
-
Summary
It seems like only pages with a "fixed" route are cached on edge.
What do I need to do to cache the pages under the second route?
Example
I have a small example app where I have a static route: https://nextjs-vercel-caching-git-wat-mastoj.vercel.app, that loads super fast when on cache, like 20ms waiting on server. https://nextjs-vercel-caching-git-wat-mastoj.vercel.app/1 on the other hand, it always waits on the server so it is almost an order of magnitude slower when it comes to wait time on server. The first url will also have the x-vercel-cache set to HIT when fast, but the second url always has it set to MISS. The code for that specific deployment is this one: https://github.com/mastoj/nextjs-vercel-caching/tree/wat
Beta Was this translation helpful? Give feedback.
All reactions