diff options
author | Francis Irving <francis@mysociety.org> | 2010-09-06 11:03:31 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-09-06 11:03:31 +0100 |
commit | ca8ecce359b254d9e54d51f776e73fbb7d94c8a8 (patch) | |
tree | e77d1ae1c89e268395f76f9e83be58bf62aa525b /app/controllers/request_controller.rb | |
parent | 8912d36b02a44ac07e9a83214d4486159cc95863 (diff) |
Cache /list pages
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 007cef5d1..3b2719b5c 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -120,13 +120,12 @@ class RequestController < ApplicationController raise "unknown request list view " + @view.to_s end - #behavior_cache do - xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') - @list_results = xapian_object.results.map { |r| r[:model] } - @matches_estimated = xapian_object.matches_estimated - - #end - #@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect + @page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect + behavior_cache :tag => [@view, @page] do + xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') + @list_results = xapian_object.results.map { |r| r[:model] } + @matches_estimated = xapian_object.matches_estimated + end @title = @title + " (page " + @page.to_s + ")" if (@page > 1) |