You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve been working with the action API in Solid-Start, particularly focusing on the behavior of the revalidate parameter. The current documentation states:
You can revalidate the cache using the revalidate method or you can set revalidate keys on your response from your actions. If you pass the whole key it will invalidate all the entries for the cache (ie "users" in the example above). You can also invalidate a single entry by using keyFor.
From my understanding, the key: string | string[] is used to precisely evict cache entries. However, I’ve noticed some unexpected behavior. If I return only data or set the key to '' or [], it ends up evicting all cache entries along the route hierarchy, which is not the desired outcome.
To avoid this, I find myself having to set a non-existent key, like "NONE" , which feels a bit counterintuitive.
Is this behavior intentional? I believe this should be clarified in the documentation to prevent confusion for other developers. Any thoughts or advice on how this behavior is meant to work?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I’ve been working with the action API in Solid-Start, particularly focusing on the behavior of the revalidate parameter. The current documentation states:
From my understanding, the key: string | string[] is used to precisely evict cache entries. However, I’ve noticed some unexpected behavior. If I return only data or set the key to '' or [], it ends up evicting all cache entries along the route hierarchy, which is not the desired outcome.
To avoid this, I find myself having to set a non-existent key, like "NONE" , which feels a bit counterintuitive.
Is this behavior intentional? I believe this should be clarified in the documentation to prevent confusion for other developers. Any thoughts or advice on how this behavior is meant to work?
Beta Was this translation helpful? Give feedback.
All reactions