Skip to content

Commit d2f1602

Browse files
committed
Update according to Goutham's comments
Signed-off-by: Giedrius Statkevičius <[email protected]>
1 parent 80c4f2d commit d2f1602

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## master / unreleased
44

5+
* [CHANGE] The frontend component now does not cache results if it finds a `Cache-Control` header and if one of its values is `no-store`
56
* [ENHANCEMENT] metric `cortex_ingester_flush_reasons` gets a new `reason` value: `Spread`, when `-ingester.spread-flushes` option is enabled.
6-
77
* [CHANGE] Flags changed with transition to upstream Prometheus rules manager:
88
* `ruler.client-timeout` is now `ruler.configs.client-timeout` in order to match `ruler.configs.url`
99
* `ruler.group-timeout`has been removed

pkg/querier/queryrange/results_cache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (s resultsCache) Do(ctx context.Context, r Request) (Response, error) {
142142
// shouldCacheResponse says whether the response should be cached or not.
143143
func shouldCacheResponse(r Response) bool {
144144
if promResp, ok := r.(*PrometheusResponse); ok {
145-
shouldNotCache := false
145+
shouldCache := true
146146
outer:
147147
for _, hv := range promResp.Headers {
148148
if hv == nil {
@@ -153,12 +153,12 @@ func shouldCacheResponse(r Response) bool {
153153
}
154154
for _, v := range hv.Values {
155155
if v == noCacheValue {
156-
shouldNotCache = true
156+
shouldCache = false
157157
break outer
158158
}
159159
}
160160
}
161-
return !shouldNotCache
161+
return shouldCache
162162
}
163163
return true
164164
}

0 commit comments

Comments
 (0)