Skip to content

Test and document cache headers for HTTP QUERY requests - #10662

Merged
glen-84 merged 1 commit into
mainfrom
gai/cache-headers-over-query
Oct 22, 2026
Merged

glen-84 merged 1 commit into
mainfrom
gai/cache-headers-over-query

Conversation

@glen-84

@glen-84 glen-84 commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Pins Cache-Control and Vary on HTTP QUERY responses. SharedMaxAgeAndVary_Should_Cache in HttpCachingTests and Query_With_SharedMaxAge_Should_Return_SMaxAge_Header in FusionCachingTests become theories with a POST row and a QUERY row, with EnableQueryRequests on. The QUERY row on the Hot Chocolate server matches the existing POST snapshot.
  • Adds a QUERY Requests section to the Hot Chocolate and Fusion cache-control pages: how to enable QUERY, that RFC 10008 makes the response cacheable with the request body in the cache key, and that GET and persisted-operation GET routes are the portable choice because CDN support for caching QUERY responses varies.

Test plan

  • HotChocolate.Caching.Tests and HotChocolate.Fusion.Caching.Tests pass on net10.0.
  • With EnableQueryRequests off, both QUERY rows fail (the server answers 404, and the gateway writes no Cache-Control), so the rows go through the QUERY path.
  • Prettier and cspell pass on both docs pages.

Copilot AI lite review requested due to automatic review settings October 22, 2026 08:48
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 22, 2026

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.

🟢 Approval recommended

The reviewed changes have no unresolved blocking issues and all approval assessments indicate readiness.

No open issues 🎉

What changed in this PR

This pull request tests and documents cache headers for HTTP QUERY requests, confirming they match equivalent POST responses when QUERY support is enabled.

Changes:

  • Extends Hot Chocolate and Fusion cache-control tests to cover POST and QUERY requests.
  • Adds reusable HTTP request helpers supporting multiple methods.
  • Documents QUERY configuration, cache-key behavior, response headers, and CDN compatibility.
File Description
website/​content/​docs/​hotchocolate/​server/​cache-control.md Documents enabling and caching HTTP QUERY requests for Hot Chocolate.
website/​content/​docs/​fusion/​cache-control.md Documents enabling and caching HTTP QUERY requests through Fusion.
src/​HotChocolate/​Fusion/​test/​Fusion.Caching.Tests/​FusionCachingTests.cs Verifies shared cache headers for POST and QUERY gateway requests.
src/​HotChocolate/​Caching/​test/​Caching.Tests/​HttpCachingTests.cs Verifies matching cache-control and Vary headers for POST and QUERY server requests.

Review effort: Lite

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

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants