Skip to content

fix: Preserve caching options after query split - #21320

Merged
benclive merged 2 commits into
mainfrom
benclive/preserve-caching-options-in-split
Mar 30, 2026
Merged

fix: Preserve caching options after query split#21320
benclive merged 2 commits into
mainfrom
benclive/preserve-caching-options-in-split

Conversation

@benclive

@benclive benclive commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Preserves the Caching options for LokiRequest objects through the splitting middleware.

  • This makes the Cache-Control: no-cache header work as expected for queries that get split.
  • Prior to this change, the header had no effect.

Note

Low Risk
Small, localized change that only copies an existing field into split sub-requests; behavior impact is limited to caching controls on split queries.

Overview
Preserves per-request CachingOptions when query splitting creates sub-requests, so cache-control settings (e.g. no-cache) are not lost after splitting.

This updates the splitter factories for LokiRequest (both default and metric query splitters) and logproto.VolumeRequest to copy CachingOptions, and adds a unit test ensuring split LokiRequests retain the original caching configuration.

Written by Cursor Bugbot for commit 56237ef. This will update automatically on new commits. Configure here.

@benclive
benclive requested a review from a team as a code owner March 30, 2026 11:44

@salvacorts salvacorts 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.

LGTM!

@benclive
benclive merged commit 9bafc1e into main Mar 30, 2026
84 checks passed
@benclive
benclive deleted the benclive/preserve-caching-options-in-split branch March 30, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants