Open
Conversation
Currently, we use `revalidatePath` to wipe the cache from the items page - reading a bite more, it seems like a simpler approach would be to just not cache the data used to load the items page, and then avoid calling revalidate. In practice, the items endpoint is already not cached anyway, since nextJS has some underlying magic to not cache any of the data if 'dynamic' functions like `headers()` are called (we call this method to fetch the client side IP address). In practice, this should do nothing, except maybe reduce a tiny bit of overhead in calling `revalidatePath`. I think this might just make some of the cache behavior a bit clearer. Additionally, I think the purpose of `revalidatePath` is to call it when data is mutated, ie, if you have a form submission or button that triggers data updates, and you want to wipe the cache so that the next GET isn't stale. Since DC is read-only, seems like we can avoid that step. If this looks okay on QA, I may reevaluate our other uses of revalidatePath as well.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sarangj
commented
Sep 29, 2025
| clientIP = null, | ||
| isRepoApi = true, | ||
| next, | ||
| cache = "force-cache", |
Contributor
Author
There was a problem hiding this comment.
note - I set this as the default since this is the default in nextJS 14 per the docs
sarangj
commented
Sep 29, 2025
Comment on lines
+43
to
+47
| logging: { | ||
| fetches: { | ||
| fullUrl: true, | ||
| }, | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
this utility only runs in dev mode, but is handy to see when data is actually being fetched
keithbauer
approved these changes
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, we use
revalidatePathto wipe the cache from the items pageheaders()are called (we call this method to fetch the client side IP address).In practice, this should do nothing, except maybe reduce a tiny bit of overhead in calling
revalidatePath. I think this might just make some of the cache behavior a bit clearer. Additionally, I think the purpose ofrevalidatePathis to call it when data is mutated, ie, if you have a form submission or button that triggers data updates, and you want to wipe the cache so that the next GET isn't stale. Since DC is read-only, seems like we can avoid that step.If this looks okay on QA, I may reevaluate our other uses of revalidatePath as well.
Ticket:
This PR does the following:
Open questions
How has this been tested? How should a reviewer test this?
Accessibility concerns or updates
Checklist: