Skip to content

Clarify OutputCache intent and limitations for classic ASP.Net.#12885

Closed
StephenMolloy wants to merge 2 commits into
dotnet:mainfrom
StephenMolloy:outputcache-positioning-update
Closed

Clarify OutputCache intent and limitations for classic ASP.Net.#12885
StephenMolloy wants to merge 2 commits into
dotnet:mainfrom
StephenMolloy:outputcache-positioning-update

Conversation

@StephenMolloy

Copy link
Copy Markdown
Member

This pull request updates the documentation for output caching across several files to clarify the intended use and limitations of the VaryBy settings. The main addition is a prominent warning that output caching and its variation mechanisms are designed for performance optimization, not for isolating sensitive or personalized content. Developers are advised not to rely on cache variation for security or audience separation, and to enforce isolation independently of cache configuration.

The most important changes are:

Documentation improvements and warnings:

  • Added an [!IMPORTANT] note to the remarks sections of all relevant output caching types (OutputCache, OutputCacheProfile, OutputCacheSection, OutputCacheParameters, PartialCachingAttribute, HttpCachePolicy, HttpCacheVaryByContentEncodings, HttpCacheVaryByHeaders, and HttpCacheVaryByParams) warning that VaryBy settings are for performance optimization, not for isolating audiences or sensitive content, and that developers must enforce isolation separately. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Clarification of behavior:

  • Expanded remarks in HttpCacheVaryByHeaders.xml and HttpCacheVaryByParams.xml to explain how VaryByHeaders and VaryByParams allow the output cache to store and serve the appropriate representation of a resource for a given request. [1] [2]

These changes help prevent misuse of output caching for security or content isolation, reducing the risk of unintentional data exposure.

Copilot AI review requested due to automatic review settings July 17, 2026 18:51
@StephenMolloy
StephenMolloy requested a review from a team as a code owner July 17, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the classic ASP.NET output-caching API reference docs to clearly warn that VaryBy* settings are intended for performance (caching alternate representations), not for isolating personalized or sensitive content.

Changes:

  • Added a prominent [!IMPORTANT] warning across multiple output-caching related types clarifying VaryBy* is not a security/isolation boundary.
  • Expanded remarks in HttpCacheVaryByHeaders and HttpCacheVaryByParams to explicitly describe serving the appropriate cached representation for a given request.
  • Refined the OutputCache remarks to describe caching “alternate representations” of content.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
xml/System.Web/HttpCacheVaryByParams.xml Adds clarification + IMPORTANT warning; expands description of what VaryByParams does.
xml/System.Web/HttpCacheVaryByHeaders.xml Adds clarification + IMPORTANT warning; expands description of what VaryByHeaders does.
xml/System.Web/HttpCacheVaryByContentEncodings.xml Adds IMPORTANT warning about VaryBy* not being for isolation/security.
xml/System.Web/HttpCachePolicy.xml Adds IMPORTANT warning in remarks for SetVaryByCustom.
xml/System.Web.UI/PartialCachingAttribute.xml Adds IMPORTANT warning for fragment caching docs.
xml/System.Web.UI/OutputCacheParameters.xml Adds IMPORTANT warning to discourage security misuse of cache variation.
xml/System.Web.Configuration/OutputCacheSection.xml Adds IMPORTANT warning for configuration section docs.
xml/System.Web.Configuration/OutputCacheProfile.xml Adds IMPORTANT warning for cache profile docs.
xml/System.Web.Caching/OutputCache.xml Updates remarks wording and adds IMPORTANT warning about cache variation limitations.

Comment thread xml/System.Web/HttpCacheVaryByParams.xml Outdated
Comment thread xml/System.Web/HttpCacheVaryByHeaders.xml Outdated
CR nits which are very slightly clarifying.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@StephenMolloy
StephenMolloy deleted the outputcache-positioning-update branch July 17, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants