Skip to content

Sync output cache with API review - #43121

Merged
sebastienros merged 13 commits into
mainfrom
sebros/cacheupdate
Aug 15, 2022
Merged

sebastienros merged 13 commits into
mainfrom
sebros/cacheupdate

Conversation

@sebastienros

Copy link
Copy Markdown
Member

Applying API review feedback, and adding anticipated changes from new one

builder.Append(KeyDelimiter)
.Append(routeValueName)
.Append('=')
.Append(Convert.ToString(routeValueValue, CultureInfo.InvariantCulture));

Copy link
Copy Markdown
Member Author

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.

// Verify existence of cookie headers
if (!StringValues.IsNullOrEmpty(response.Headers.SetCookie))
{
context.Logger.ResponseWithSetCookieNotCacheable();

Copy link
Copy Markdown
Member Author

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.


// 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)

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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).

@wtgodbe wtgodbe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sebastienros
sebastienros merged commit ff444e5 into main Aug 15, 2022
@sebastienros
sebastienros deleted the sebros/cacheupdate branch August 15, 2022 19:03
@ghost ghost added this to the 7.0-rc1 milestone Aug 15, 2022
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants