From 4f8dfd84b96c368841a7ea16551e62674224784a Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 9 Sep 2014 10:25:49 +1000 Subject: [PATCH] FIX: vary accept for cache, seems most correct --- lib/middleware/anonymous_cache.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/middleware/anonymous_cache.rb b/lib/middleware/anonymous_cache.rb index 5eeb6030fa8..db8192fc127 100644 --- a/lib/middleware/anonymous_cache.rb +++ b/lib/middleware/anonymous_cache.rb @@ -44,13 +44,8 @@ module Middleware @is_crawler == :true end - def accept_html? - accept = @env["HTTP_ACCEPT"] - !!(accept && accept =~ /html/) - end - def cache_key - @cache_key ||= "ANON_CACHE_#{accept_html?}_#{@env["HTTP_HOST"]}#{@env["REQUEST_URI"]}|m=#{is_mobile?}|c=#{is_crawler?}" + @cache_key ||= "ANON_CACHE_#{@env["HTTP_ACCEPT"]}_#{@env["HTTP_HOST"]}#{@env["REQUEST_URI"]}|m=#{is_mobile?}|c=#{is_crawler?}" end def cache_key_body