FIX: Bypass AnonymousCache for /srv/status route. (#11491)

`/srv/status` routes should not be cached at all. Also, we want to
decouple the route from Redis which `AnonymouseCache` relies on. The
`/srv/status` should continue to return a success response even if Redis
is down.
This commit is contained in:
Alan Guo Xiang Tan
2020-12-16 13:47:46 +08:00
committed by GitHub
parent 89bf64c0bf
commit 38b6b098bc
2 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,10 @@ describe Middleware::AnonymousCache do
it "is false if it has an auth cookie" do
expect(new_helper("HTTP_COOKIE" => "jack=1; _t=#{"1" * 32}; jill=2").cacheable?).to eq(false)
end
it "is false for srv/status routes" do
expect(new_helper("PATH_INFO" => "/srv/status").cacheable?).to eq(false)
end
end
context "per theme cache" do