Skip to content

Align HttpSys caching with ResponseCaching checks #69671

Agent suggestions

Public preview

Description

@BrennanConroy

ResponseCaching checks values like no-store and no-cache when deciding whether a response should be cached.

var responseCacheControlHeader = context.HttpContext.Response.Headers.CacheControl;
// Only cache pages explicitly marked with public
if (!HeaderUtilities.ContainsCacheDirective(responseCacheControlHeader, CacheControlHeaderValue.PublicString))
{
context.Logger.ResponseWithoutPublicNotCacheable();
return false;
}
// Check response no-store
if (HeaderUtilities.ContainsCacheDirective(responseCacheControlHeader, CacheControlHeaderValue.NoStoreString))
{
context.Logger.ResponseWithNoStoreNotCacheable();
return false;
}
// Check no-cache
if (HeaderUtilities.ContainsCacheDirective(responseCacheControlHeader, CacheControlHeaderValue.NoCacheString))
{
context.Logger.ResponseWithNoCacheNotCacheable();
return false;
}

HttpSys currently relies on public, we should update the checks here to avoid any mistakes that could come from user error adding both public and a non-caching primitive.

// We require 'public' and 's-max-age' or 'max-age' or the Expires header.

Activity

  1. added
    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    Triage Summary

    Area: area-networking (HttpSys response caching in src/Servers/HttpSys)
    Type: Task (align HttpSys cache-control checks with ResponseCaching)

    Potential Duplicates

    • None found

    Generated by Issue Triage Agent for dotnet/aspnetcore for #69671 · copilot · auto · 25.2 AIC · ⌖ 10.5 AIC · ⊞ 29.9K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-httpsys

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions