diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-11-25 16:32:07 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-11-25 16:32:07 +0000 |
commit | d638509307854382ff981f188fb6d2cd584337ec (patch) | |
tree | 0e610dab86e1c0cab1bfd9ecb4b71775dcd2196b /app/controllers/request_controller.rb | |
parent | 9ebe45cc5363dd7f9398b974e5a48530a27d8d28 (diff) | |
parent | d29ab6b1ef7b005b3dbd2e0f1c295e2022794267 (diff) |
Merge branch 'feature/restore-caching' into rails-3-develop
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 388473b51..841950cd5 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -92,15 +92,8 @@ class RequestController < ApplicationController # Sidebar stuff @sidebar = true - # ... requests that have similar imporant terms - begin - limit = 10 - @xapian_similar = ActsAsXapian::Similar.new([InfoRequestEvent], @info_request.info_request_events, - :limit => limit, :collapse_by_prefix => 'request_collapse') - @xapian_similar_more = (@xapian_similar.matches_estimated > limit) - rescue - @xapian_similar = nil - end + @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 } ] @@ -971,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 |