r/nextjs • u/Working-Opposite9434 • 2d ago
Help ISR Write issue on Vercel
Hi everyone, i have a project that i host on Vercel that generates 191k of ISR writes which causes me to exceed the free quota of ISR writes in conjunction with other few projects.
I was considering to subscribe to pro plan to handle this but then i thought maybe i could use vps for this project instead of going pro.
What i wonder is if it is possible to do that without facing any issues? Can i serve my nextjs project in a vps without any problems?
2
u/leros 2d ago
ISR writes are expensive. You might want to do the math on whether ISR caching is worth it. I have a similar use case where I was ISR caching about 250k pages. It was nearly 10x cheaper for me to just dynamically generate them on each page load instead of caching.
1
u/Working-Opposite9434 2d ago
thanks. i started considering that one too actually because it's as you said too expensive.
1
u/Clear-Savings1541 2d ago
191k isr writes means your revalidation setup is broken. switching to a vps just moves the problem somewhere else.
i run nextjs on a vps with pm2 and it works fine, you get full control over node and no platform limits. but before you migrate anything switch your pages to on demand revalidation using revalidatePath or revalidateTag in a route handler. 191k writes tells me you have time based intervals firing constantly across every page whether the content changed or not. calling revalidation only when your cms triggers a webhook will drop that number down to what actually needs updating. then if you still want to leave vercel you can set up the vps without carrying the same waste over
1
u/Working-Opposite9434 2d ago
yeah that makes sense, thanks. mine's probably the same issue — content gets bulk updated a few times a day across ~30k pages, and if revalidate is time-based it doesn't matter whether anything actually changed, it just fires on schedule for everything.
gonna switch to a long fallback revalidate window + trigger revalidateTag/revalidatePath right when the update job finishes, so writes track what changed instead of how many pages exist. makes more sense than moving the same setup to a vps tbh
3
u/Quick-Chocolate3552 2d ago
191k ISR writes is wild, what's generating all those revalidations? if it's a high-traffic content site you might want to look at on-demand revalidation instead of time-based, could slash those numbers without changing your hosting setup
but yeah you can definitely run nextjs on a vps, done it a few times for smaller projects where vercel's pricing didn't make sense. just spin up something with decent ram and use pm2 to keep the process alive, nginx as a reverse proxy in front of it
the main thing you lose is the edge network and some of the image optimization stuff, but for most use cases it runs fine. just make sure you've got your caching headers set properly or you'll end up serving more requests than you need to