-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: implement cache control (#1974)
* querier: do not cache results if requested Add an extra `Headers` field to the `PrometheusResponse` message which contains the headers and their values that came from Prometheus. Use them in other places to deduce if the response should be cached. If `Cache-Control` is equal to `no-store` then it is *not* cached. This will be used by the Thanos project to indicate when a partial response has been returned. In such cases the result should not be cached so that invalid data would not be stored there. Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * queryrange: factor out cache checking + add tests Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: gofmt Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: tests: add missing member Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: fix logical mistake Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * queryrange: fix generated code Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: test adjustments Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: test adjustments Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * querier: results_cache: cache by default Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * queryrange: cache: check all header values `Cache-Control` might contain more than one value so check all of them. Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * Update according to Goutham's comments Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com> * CHANGELOG: add full stop, PR's number Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
- Loading branch information
Showing
7 changed files
with
523 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters