Include Host, Port and Scheme in Cache Key
KLuuKer opened this issue · 2 comments
KLuuKer commented
Multi tenant applications may return different content for the same path+query but with a different host header value
Maybe add the Host value to the cache key, or provide a way to customize it using code
JunTaoLuo commented
This would be a simple change here: https://github.com/aspnet/ResponseCaching/blob/dev/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCachingKeyProvider.cs#L55-L57. However, we need to finalize our design for cache keys and address #54.
JunTaoLuo commented
We've decided to make the change without waiting on the cache key redesign.
In addition to the current key, which includes method and path, we will add Scheme, Host and Port to the base cache key.