13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/action_controller/caching/pages.rb', line 13
def caches_redis_page(*actions)
options = actions.
before_filter({only: actions}.merge(options)) do |c|
@page_need_to_cache = true
if options[:append_country]
@cache_country = (cookies[:country] || request.['X-IP-Country']).upcase
end
end
after_filter({only: actions}.merge(options)) do |c|
path = request.path
path = "#{path}-#{@cache_country}" if @cache_country
c.cache_page(response.body, path)
c.record_cached_page
end
end
|