mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: vary accept for cache, seems most correct
This commit is contained in:
parent
8646c21e89
commit
4f8dfd84b9
1 changed files with 1 additions and 6 deletions
|
@ -44,13 +44,8 @@ module Middleware
|
||||||
@is_crawler == :true
|
@is_crawler == :true
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept_html?
|
|
||||||
accept = @env["HTTP_ACCEPT"]
|
|
||||||
!!(accept && accept =~ /html/)
|
|
||||||
end
|
|
||||||
|
|
||||||
def cache_key
|
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
|
end
|
||||||
|
|
||||||
def cache_key_body
|
def cache_key_body
|
||||||
|
|
Loading…
Reference in a new issue