Skip to content

[release/7.0] Support populating cache without serving from it. #47481

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

Closed
wants to merge 4 commits into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 29, 2023

Backport of #47392 to release/7.0

/cc @mitchdenny

Support populating cache without serving from it.

Description

At the moment if a developer sets AllowCacheLookup to false but AllowCacheStorage to true the output caching middlewhere will throw a null reference exception which is obviously not intended. The problem stems from the fact that the cache key that cache storage relies on is a side effect of looking up the cache. This change simply makes it so that the cache key is created even if just AllowCacheStorage is enabled.

This is a useful scenario because someone might want to implement a cache refresh mechanism which forces to repopulation of the cache without attempting to first fetch what might be considered stale data. The test case in this PR illustrates this scenario.

Fixes #46671

Customer Impact

{Justification}

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

We are just calling CreateCacheKey a second time. If the key is already created the method no-ops - so this just enables the scenario mentioned above.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@ghost ghost added area-runtime labels Mar 29, 2023
@ghost ghost added this to the 7.0.x milestone Mar 29, 2023
@ghost
Copy link

ghost commented Mar 29, 2023

Hi @github-actions[bot]. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document.
Otherwise, please add tell-mode label.

@mitchdenny mitchdenny added the Servicing-consider Shiproom approval is required for the issue label Mar 29, 2023
@ghost
Copy link

ghost commented Mar 29, 2023

Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@mitchdenny mitchdenny closed this Apr 4, 2023
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 6, 2023
@wtgodbe wtgodbe deleted the backport/pr-47392-to-release/7.0 branch November 15, 2024 23:28
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 Servicing-consider Shiproom approval is required for the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants