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

We need to find a way to manually refresh the next.js cache #1277

Open
dadiorchen opened this issue Dec 9, 2022 · 7 comments
Open

We need to find a way to manually refresh the next.js cache #1277

dadiorchen opened this issue Dec 9, 2022 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dadiorchen
Copy link
Collaborator

I just encountered this problem:

  1. visit https://beta-map.treetracker.org/organizations/fcctrees it return 404, at this moment it is correct, because we don't have this org
  2. Then create organization by name: fcctrees
  3. visit the URL again, it is still 404
  4. Only way to refresh is to restart the next.js

We need to find a way to trigger the refresh and correct the 404 failure.


Some hints:

@dadiorchen dadiorchen added bug Something isn't working enhancement New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Dec 9, 2022
@dadiorchen
Copy link
Collaborator Author

@okdv I remember you did some research on this right?

@okdv
Copy link
Contributor

okdv commented Dec 9, 2022

@dadiorchen ah yes, if i remember correctly we could create an endpoint that would manually refresh the cache for a specified page. there may also be a way to not cache the page at all if it routes to a 404 or something- but im not sure, i would need to look into that some more

been away working on a private contract so havent had much time for side stuff lately, but that contract should be done in about a week and i'll be back contributing some more 😄 let me look into this in the meantime and see what i can find

@keyy123
Copy link
Contributor

keyy123 commented Dec 30, 2022

@okdv will you be back soon? 😟

Like @okdv said, We could make an endpoint to manually refresh it on demand but it seems that the organization page get the values from props which is already set up to revalidate every 43.2 seconds or defaults to 30s if the env for cache revalidation is not provided.

Do you want me to reduce the time for the cache to revalidate. Also, how do I create and delete an organization? I want to reproduce the bug, but FCC is already established so I can't reproduce with the same example @dadiorchen

@okdv
Copy link
Contributor

okdv commented Dec 30, 2022

#1020 is the PR I had for this a while ago but forgot to fix the wrong HTTP error code

just updated that and submitted the PR for review

sorry holiday season has been crazier than expected 😄

@dadiorchen
Copy link
Collaborator Author

Actually the revalidate time now is 24 hours, we need to be so so we get better performance, this is just the difficulty we need to solve, setting a cache in normal, but need a special way to kick out it and refresh the page.

@okdv
Copy link
Contributor

okdv commented Jan 8, 2023

@dadiorchen makes sense for the cache timing. Does that endpoint satisfy the needs as far as cache revalidation goes? Or should there be some additional functionality to it?

@dadiorchen
Copy link
Collaborator Author

This is still a valid issue, here is @okdv 's work #1020
we need someone who can continue and finish this for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants