Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support for on-Demand Revalidation #1288

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

Closed
kamerat opened this issue Mar 31, 2022 · 35 comments
Closed

Support for on-Demand Revalidation #1288

kamerat opened this issue Mar 31, 2022 · 35 comments
Assignees
Labels
v4 Issues related to the v4 Next.js runtime

Comments

@kamerat
Copy link

kamerat commented Mar 31, 2022

I'm having issues using the on-demand revalidation when hosted on netlify.
When I test it locally by doing next build and next start it works. However, when I test it on a build-deploy or live, it does not seem to update the page.

I have validated that the API endpoint in netlify gets run, has the correct data and unstable_revalidate did not break. (in ___netlify-handler function log)

Does on-demand revalidation not work on netlify yet, or am I missing some config?

EDIT:

Also discussed in #1228

Originally posted by iankduffy February 18, 2022
Hello, NextJS 12.1 has added On-demand Incremental Static Regeneration currently in Beta / Unstable, just wondering if in the future if we are looking to add this to netlify plugin?

@ascorbic
Copy link
Contributor

ascorbic commented Apr 1, 2022

Hi @kamerat
Currently on-demand revalidation is not supported. It is on our roadmap, but we cannot share a date for support yet.

@EddyVinck
Copy link

@ascorbic is unstable_revalidate unsupported still? I just tried it and it seems to not work, at least.

@yescine
Copy link

yescine commented Jul 24, 2022

@ascorbic Still to this date with [email protected] res.revalidate(), it doesn' t update the page although the revalidate api endpoint handle the request.

@ascorbic
Copy link
Contributor

@yescine @EddyVinck in progress!

@iurage
Copy link

iurage commented Sep 2, 2022

Hi, any updates on progress for this?

@orinokai
Copy link
Contributor

orinokai commented Sep 5, 2022

@iurage we are keen to support this as soon as possible and are working toward it as per our roadmap

@ChazUK
Copy link

ChazUK commented Nov 11, 2022

Would be good to hear an update on this. It's been a much talked about feature in my team and we're really looking forward to selling this performance benefit to our clients!

@pm0u
Copy link

pm0u commented Nov 11, 2022

Really would like to see this for feature parity with other hosting providers. Any updates on timeline? This is bordering on dealbreaker for us as we have a massive blog that we can't realistically rebuild every time someone finds a typo.

@ascorbic
Copy link
Contributor

I'm afraid I can't be any more specific than "this is being worked on". We're waiting on some new platform features that we need for this to work, but I think you'll be pleased with the results.

@elleryfamilia
Copy link

elleryfamilia commented Jan 7, 2023

"this is being worked on"... i mean, seems like a trivial task given that you already support {revalidate: 60}. If you're concerned about resource use, then just paywall it. It wouldn't be so bad if we also didn't have to wait 60 seconds for revalidation... maybe bring that down to 10 seconds?

@ascorbic
Copy link
Contributor

ascorbic commented Jan 8, 2023

i mean, seems like a trivial task given that you already support

You know that they there say are the two hard problems in computer science?

@theooog
Copy link

theooog commented Feb 20, 2023

@ascorbic Any updates?

@nickytonline
Copy link

It's actively been looked at at the moment, but I can't provide a timeline yet @theooog.

@BilegtGG
Copy link

?

theredfish added a commit to theredfish/indiedevcasts that referenced this issue Apr 21, 2023
Netlify doesn't support on-demand revalidation yet.
See: opennextjs/opennextjs-netlify#1288.

The documentation states that cache control for SSR pages
isn't supported. By using `force-dynamic` it is equivalent
to the `getServerSideProps` function used in the previous
version.
@Raphael2001
Copy link

Hey, any update on that?

@orinokai
Copy link
Contributor

@Raphael2001 not too long now πŸ˜„

@ui-jb
Copy link

ui-jb commented Jun 5, 2023

Hey guys, I'm sure you're sick of people asking, but my team is really excited about this feature.

Are there any updates to this? Or maybe a timeframe? Hopefully I'm not adding too much pressure πŸ˜„

@cbaucom
Copy link

cbaucom commented Jun 5, 2023

Probably easier to switch to Vercel at this point.

@osseonews
Copy link

Probably easier to switch to Vercel at this point.

Guaranteed that right after we switch to Vercel, Netlify will fix this. But growing extremely impatient at the lack of updates on this. Terrible having to manage a NextJS implementation without on demand revalidation.

@justynspooner
Copy link

justynspooner commented Jun 20, 2023

@orinokai @ascorbic Our team would also love NextJS On-Demand Revalidation supported on Netlify. Looking forward to seeing this released! Do you have a public roadmap where we can follow along with the progress on this feature?

@nickytonline nickytonline self-assigned this Jun 20, 2023
@orinokai
Copy link
Contributor

@justynspooner i'm afraid we don't currently maintain a public roadmap, but please be assured it's a priority and we're working hard to get this shipped

@tomswork
Copy link

tomswork commented Jul 5, 2023

+1 - It would be great to get ongoing updates on this feature, it has major impacts to us in project usages / api limits and bandwidths

@charkour
Copy link

What are the current pending tasks that need to be completed for this to go live?

Because this is an open-source plugin, we'd like to contribute to it via a public checklist.

@caomicc
Copy link

caomicc commented Sep 20, 2023

Wondering if there are any updates for this?

@nickytonline nickytonline removed their assignment Sep 20, 2023
@dev-fredericfox
Copy link

It has been more than a year, can we at least get an update and or ETA?

@charkour
Copy link

charkour commented Sep 28, 2023

@dev-fredericfox, although it's undocumented, this feature is enabled for Next.js sites on Netlify based on my experience.

Does it work for you?

@dev-fredericfox
Copy link

dev-fredericfox commented Sep 28, 2023

@charkour Dosen't seem to work for me. Did you get it to work on 13 with the app router?
It works fine locally (Next.js 13 App router), and the webhook returns "ok" when on netlify, but the pages do not refresh.

@azuxx
Copy link

azuxx commented Sep 28, 2023

Screenshot 2023-09-28 at 16 35 59 Revalidate does not work for me either (using Next 13 with App Router). My current workaround is to redo deploy with the option "Clear cache and retry with latest branch commit".

@charkour
Copy link

@dev-fredericfox, what is your revalidate: <ttl>? For example, my TTL is set to 60 seconds, so even when I run revalidate, my browser will cache the webpage until the TTL is up. Locally, Next.js will immediately update the page (when using next start) but with Netlify, it will start the TTL count the moment the page is loaded (not based on when it was built on the server).

@charkour
Copy link

Revalidate on Next.js 13.3 with the Pages Router works on Netlify. You could email Netlify Support asking if there is anything that needs to be "enabled" on your account, but I don't think that's the case.

@charkour
Copy link

To test if revalidate is working, you should server-render a timestamp and then mount that in your DOM: "build at ". That way you can see when the server revalidated the page. Or, you could open the webpage in a new browser (which hasn't cached the webpage) and it will immediately show the updated page.

@dev-fredericfox
Copy link

@charkour thanks a lot for your feedback!

I am using the App router, not pages.

I am revalidating by tag and/or URL. My netlify demo-build is outputting a server generated timestamp, that's how I can tell it is not regenerating the page (the timestamp === the build timestamp, even after post-ing to the revalidate api route). This all works when working locally with next start.

I have not set any ttl, maybe that is the issue, what is the default? I have waited more than an hour before trying the revalidation again, but still nothing.

@charkour
Copy link

@dev-fredericfox, I don't believe there is any default set according to the Netlify Next.js Docs. You could try setting it to 60 seconds.

I'm not certain Netlify supports the App router On-demand ISR yet.

@MarcL MarcL added v4 Issues related to the v4 Next.js runtime and removed Ecosystem: Frameworks labels Mar 13, 2024
@MarcL
Copy link
Contributor

MarcL commented Mar 13, 2024

Hey folks,

We've released an early access version of our new runtime which you can opt-in to via the Netlify app UI or you can manually install it. This should have full support for app router and the various flavours of revalidation for pages and app router. We'll be rolling this out to everyone in the next few weeks but you can try it now.

You'll need Next 13.5+ and Node 18 but it should fix a lot of these issues.

More info here in the docs: Netlify Next.js

Let us know if you run into any issues.

Thanks!

@MarcL
Copy link
Contributor

MarcL commented Apr 18, 2024

Page router ISR and app router revalidation should now be available for everyone in our new v5 runtime.

Docs and more info here: Netlify Next.js

Closing this issue but feel free to raise a new one if you spot any issues.

@MarcL MarcL closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 Issues related to the v4 Next.js runtime
Projects
None yet
Development

No branches or pull requests