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
@@ -280,11 +280,9 @@ Normally the answer would be yes, but in this case is a resounding _"nope!"_ bec
280
280
281
281
### 🔑 Cache Key Prefix
282
282
283
-
In the code above we also added `WithCacheKeyPrefix()`: that tells FusionCache to add a prefix to each cache key we will pass to it, solving the issue automatically.
283
+
In the code above we also added `WithCacheKeyPrefixByCacheName()`: that tells FusionCache to add the cache name plus a little `:` separator as a prefix to each cache key we will pass to it, solving the issue automatically.
284
284
285
-
By default, when no specific prefix is specified, the `CacheName` plus a little `":"` separator will be used.
286
-
287
-
Of course it can also be specified manually, by simply using the overload `WithCacheKeyPrefix(prefix)`.
285
+
Of course it can also be specified manually, by simply using `WithCacheKeyPrefix(prefix)`.
288
286
289
287
Basically when doing `_productsCache.Set("Foo123", myProduct)` from the example above the actual cache key used in both the underlying memory and distributed cache will be turned from `"Foo123"` to `"Products:Foo123"`, automatically and transparently avoiding any collision between different cache entries from different caches. The transformed cache key will be used consistently throughout the entire flow: memory cache, distributed cache, events, etc.
0 commit comments