FEATURE: anon cache reports data to loggers

This allows custom plugins such as prometheus exporter to log how many
requests are stored in the anon cache vs used by the anon cache.

This metric allows us to fine tune cache behaviors
This commit is contained in:
Sam Saffron
2019-09-02 18:45:35 +10:00
parent afeb7e4b55
commit 08743e8ac0
3 changed files with 25 additions and 3 deletions

View File

@ -182,6 +182,8 @@ module Middleware
$redis.setex(cache_key_body, cache_duration, parts.join)
$redis.setex(cache_key_other, cache_duration, [status, headers_stripped].to_json)
headers["X-Discourse-Cached"] = "store"
else
parts = response
end