How to change the Prefix of the cache key? #480
-
Hello folks, I'm using this package with Redis for caching my API. As I guess, cache prefix of the key in Spatie Cache Response is constructed from 3 separated parts:
This unknown string is default: "responsecache" I already utilize Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
AnswerIt's not possible due to the "responsecache" string is built-in the Default Hasher, inside the
|
Beta Was this translation helpful? Give feedback.
Answer
It's not possible due to the "responsecache" string is built-in the Default Hasher, inside the
getHashFor
function. One way to work around this is write your own Hasher that extends DefaultHasher, re-implementgetHashFor
function to achieve the desired return string.