-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Sync output cache with API review #43121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
builder.Append(KeyDelimiter) | ||
.Append(routeValueName) | ||
.Append('=') | ||
.Append(Convert.ToString(routeValueValue, CultureInfo.InvariantCulture)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A route value is an object
as opposed to headers and queries. I think we need to force the culture here for normalize the key.
@@ -46,15 +46,13 @@ ValueTask IOutputCachePolicy.ServeResponseAsync(OutputCacheContext context, Canc | |||
// Verify existence of cookie headers | |||
if (!StringValues.IsNullOrEmpty(response.Headers.SetCookie)) | |||
{ | |||
context.Logger.ResponseWithSetCookieNotCacheable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed logs from this policy as it requires the logger to be resolved (on each request?) and also because further policies can negate the results here and the lot would be wrong.
var varyByPrefix = context.CacheVaryByRules.VaryByPrefix; | ||
|
||
// Check if any vary rules exist | ||
if (!StringValues.IsNullOrEmpty(varyHeaders) || !StringValues.IsNullOrEmpty(varyQueryKeys) || !StringValues.IsNullOrEmpty(varyByPrefix) || varyByCustomKeys?.Count > 0) | ||
if (!StringValues.IsNullOrEmpty(varyHeaderNames) || !StringValues.IsNullOrEmpty(varyRouteValueNames) || !StringValues.IsNullOrEmpty(varyQueryKeys) || !StringValues.IsNullOrEmpty(varyByPrefix) || varyByCustomKeys?.Count > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is pretty long, may be better to wrap it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another PR that will remove it, so I will ignore it for now (if I may).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Applying API review feedback, and adding anticipated changes from new one