From b54aef5dda20fc9ff15a0ef3dd72327e52c8604c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 21 Nov 2013 14:53:11 +0000 Subject: Cache the similar requests for 1 day --- app/controllers/request_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 341ecdcd5..841950cd5 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -92,6 +92,8 @@ class RequestController < ApplicationController # Sidebar stuff @sidebar = true + @similar_cache_key = cache_key_for_similar_requests(@info_request, @locale) + # Track corresponding to this page @track_thing = TrackThing.create_track_for_request(@info_request) @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ] @@ -962,5 +964,10 @@ class RequestController < ApplicationController file_info end + def cache_key_for_similar_requests(info_request, locale) + "request/similar/#{info_request.id}/#{locale}" + end + + end -- cgit v1.2.3