Skip to content

Commit 9fd7436

Browse files
mgravelltdykstra
andauthored
Update aspnetcore/performance/caching/hybrid.md
Co-authored-by: Tom Dykstra <[email protected]>
1 parent 020e9a0 commit 9fd7436

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

aspnetcore/performance/caching/hybrid.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ This guidance applies equally to any `string`-based cache API, such as `HybridCa
9090

9191
Notice that the inline interpolated string syntax (`$"..."` in the preceding examples of valid keys) is directly inside the `GetOrCreateAsync` call. This syntax is recommended when using `HybridCache`, as it allows for planned future improvements that bypass the need to allocate a `string` for the key in many scenarios.
9292

93-
Additional key restrictions:
93+
### Additional key considerations
9494

95-
- keys may restricted to valid lengths; for example, the default `HybridCache` implementation (via `AddHybridCache(...)`) restricts keys to 1024 characters by default, (configurable via `HybridCacheOptions.MaximumKeyLength`) with longer keys bypassing the cache mechanisms to prevent saturation.
96-
- keys must be valid unicode sequences; if invalid unicode sequences are passed, the behaviour is undefined.
97-
- when using an out-of-process secondary cache (`IDistributedCache`), the specific backend implementation may impose additional restrictions - as a hypothetical example (no such actual
98-
backend is known), a particular backend might use case-insensitive key logic; the default `HybridCache` (via `AddHybridCache(...)`) will detect this scenario to prevent confusion attacks, however it may still result in conflicting keys becoming overwritten/evicted sooner than expected.
95+
* Keys can be restricted to valid maximum lengths. For example, the default `HybridCache` implementation (via `AddHybridCache(...)`) restricts keys to 1024 characters by default. That number is configurable via `HybridCacheOptions.MaximumKeyLength`), with longer keys bypassing the cache mechanisms to prevent saturation.
96+
* Keys must be valid Unicode sequences. If invalid Unicode sequences are passed, the behavior is undefined.
97+
- When using an out-of-process secondary cache such as `IDistributedCache`, the specific backend implementation may impose additional restrictions. As a hypothetical example, a particular backend might use case-insensitive key logic. The default `HybridCache` (via `AddHybridCache(...)`) detects this scenario to prevent confusion attacks, however it may still result in conflicting keys becoming overwritten or evicted sooner than expected.
9998

10099
### The alternative `GetOrCreateAsync` overload
101100

0 commit comments

Comments
 (0)