Skip to content
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

Research: could we manually trigger the cache update for next.js #998

Closed
dadiorchen opened this issue Sep 23, 2022 · 5 comments · May be fixed by #1020
Closed

Research: could we manually trigger the cache update for next.js #998

dadiorchen opened this issue Sep 23, 2022 · 5 comments · May be fixed by #1020
Labels
challenge hard, tricky, problem enhancement New feature or request low-priority nextjs

Comments

@dadiorchen
Copy link
Collaborator

dadiorchen commented Sep 23, 2022

Currently, we are going to use the next.js's cache to speed up the performance, and set an expiration time for that. Can we find a way to manually trigger some page's cache update so we can get the newest data immediately.

This is to bring convenience for our operator, usually, after doing some data management, they want to check the result on the map immediately, but with the cache of next.js, they need to wait.

@okdv
Copy link
Contributor

okdv commented Sep 23, 2022

On-demand revalidation should work in nextjs out of the box: https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#using-on-demand-revalidation

Basically they recommend creating an endpoint where we can supply a token and the path to revalidate, it'll purge the cache and force re-render on next call. Then we can just call this endpoint when/where needed. I'm happy to take a look and draft up a PR assuming all goes well

@dadiorchen
Copy link
Collaborator Author

Okay, great, then let's define this issue to test this next.js feature, and put the guiding document into our readme.

@okdv
Copy link
Contributor

okdv commented Dec 30, 2022

related to #1277

@dadiorchen
Copy link
Collaborator Author

Duplicated issue

@dadiorchen
Copy link
Collaborator Author

duplicated issue

@dadiorchen dadiorchen reopened this Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge hard, tricky, problem enhancement New feature or request low-priority nextjs
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants