Replies: 1 comment 3 replies
-
You should use a custom cache key for the requests. If you don’t provide one, it will use the name of the request and the headers passed to generate a key. When you have the same requests with different arguments, you should make a custom key with that ID in the key, to make it unique. You could also share the same key across both show/list routes so the cache is invalidated everywhere. See here for more: https://docs.saloon.dev/next-steps/caching#custom-cache-keys |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am building a SDK for an API and have a practical question about the caching plugin.
I have (among others) the following requests:
ListRecords
GetRecord
UpdateRecord
If the first 2 requests are cached and I update one of the records (id 1), the cache of the first 2 requests will now be outdated. How can I practically implement the invalidation of the cache of the
ListRecords()
request and theGetRecord(1)
request after aUpdateRecord(1)
request?Beta Was this translation helpful? Give feedback.
All reactions