unstable_cache tags using request result #75959
Unanswered
PierreCavalet
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
It has been discussed many times that the unstable_cache API cannot use the result of its async function parameter to tag its content. There are some suggestions such has the one mentionned here by Romeovs which suggest to send the request twice, with the drawback of loosing the tags in between requests, which could lead to some revalidation problems.
For context, I'm using unstable_cache mainly to apply tags to my page ISR cache. What if instead of using unstable cache with your async function, you call your async function before and use an empty one just to tag the page by side effect:
I tried it, it seems to work but I'm just trying to find out what could go wrong, it feels like I'm only missing on the "fetch" cache, which I'm ok with if it is the only drawbacks.
I'm aware the best solution would be to use "use cache" but since it is not available for now, I'm trying to find the best alternative.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions