-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update middleware.js #2624
Update middleware.js #2624
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@saimonkat can you help me in this PR? I want to make the homepage as static asset and not as an ISR page. Is there something we're fetching on the server that we need to revalidate on the homepage after it is deployed? |
@rishi-raj-jain I guess the only one thing we need to revalidate on the homepage it's GitHub stars count. That's why we has to disable it in this PR: #2589 for error pages But let me check, I'll research deeper soon |
I think we can avoid that atleast for / and /home since it'd fetch it during the initial render on the server anyways. |
@rishi-raj-jain ok as I see, you already removed revalidate from the main Homepage in this PR #2621 In this case we're free to remove it from other copies of Homepage, I updated in the last commit |
@saimonkat somehow it still lands up being in ISR: |
@rishi-raj-jain are you testing the current PR Preview? Can you let me know how to test it please |
Did you get a chance at my comment at #2624 (comment)? |
I think this is rooting from wordpress pages, testing. |
In the next output it shows that it is a static page, but somehow the homepage it still marked as ISR function when deployed on Vercel. |
@rishi-raj-jain it looks like the Vercel issue, please check
Anyway I think we good to merge this PR as soon as we don't need revalidate for home pages |
Hmm, I see. I have commented on the tweet. Would removing the revalidate do anything? It still will fall into ISR, right? |
Trying specifying no revalidate explicity via https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate. |
@rishi-raj-jain just noticed that we missed |
Hi @rishi-raj-jain , could you please clarify how a client-side redirect could be faster than using middleware? For instance, if we add the |
I added a redirect from '/home' to '/' which takes care of it, does that work? |
It's faster for TTFB - now the state of the homepage is exactly as like a static asset, served asap.
Exactly what the original suggestion was - PPR but here we're defaulting to immediate script on the client instead of on the server. |
Now it works, thanks! I see you rolled back the middlewares file with the correct conditions |
No description provided.