How to force cache revalidation in Next.js 15 when using Mongoose instead of the native fetch API?
asked 75 days ago
0
0
I am trying to implement data caching for my question feed page using Next.js 15. When using the native fetch API, it is very straightforward to set up time-based revalidation or tag-based revalidation using options like { next: { revalidate: 3600, tags: ['questions'] } }.
However, my application queries MongoDB directly using Mongoose (Question.find()), which bypasses the global network fetch overrides completely. Because of this, my data is either fetched dynamically on every single page view (ruining performance), or it gets statically cached during the production build and never updates when a user posts a new question.
Here is my current data fetching function:
0 Answers


No Answers Found
The answer board is empty. Make it rain with your brilliant answer.
1