Optimizing Blog Post Updates with ISR in a Portfolio Website #65955
Unanswered
AnmolSaini16
asked this question in
Help
Replies: 1 comment 1 reply
-
You can create an API endpoint to trigger revalidation and update the cache when a new post is published. This way, users will see the latest posts without needing to refresh the page twice. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have created a portfolio website that includes a blog page. To fetch the blog posts, I've integrated the dev.to API and used the Incremental Static Regeneration (ISR) approach for faster loading of blogs, setting the revalidation period to 30 minutes. However, there's an issue: if I publish a new post, users must visit the site twice or refresh the page twice after 30 minutes to see the update (a default behavior in Next.js for server revalidation).
This doesn't seem very ideal. Any suggestions for a better data-fetching approach? I'm considering using on-demand ISR with an API to manually revalidate the blog posts.
Additional information
Beta Was this translation helpful? Give feedback.
All reactions