Revalidating a cache in a server component ('use cache') #77729
Unanswered
LaurinBrechter
asked this question in
Help
Replies: 1 comment 1 reply
-
Yeah, calling this as you render is not supported... but there's an API called I see a minor, kind of issue, your page renders, have a side effect, and that's maybe not ideal... GET requests, should be designed to be idempotent, and adding a resource, maybe is not necessarily so? What is it you are trying to accomplish? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I am using the new 'use cache' directive and have a function
getUserResources
that is cache tagged and a functionaddUserResource
that adds a new resource when the user visits the resource. The functionaddUserResource
should invalidate the tag forgetResources
but, since I am running it inside a server component I can't do that and I get the error message below.My current solution is to just use the API route for adding a resource but I was wondering if calling the function with
revalidateTag
is possible somehowAdditional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions