diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-03-04 10:46:46 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-03-04 10:46:46 +0000 |
commit | ede46dc8dc6c97cdad8c3fcb3bd42ede5c25f395 (patch) | |
tree | 44e03358c9fa7ca6826e631d1d3d6c1030b1b0d5 /app/helpers/application_helper.rb | |
parent | 8e911d5bd0e60a0e0e4859868662cc176419d2e3 (diff) | |
parent | a38b2989aebf8d554b7287e18528bed8c9e67d3b (diff) |
Merge branch 'release/0.17'0.17
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4b603b064..154697377 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -123,5 +123,18 @@ module ApplicationHelper yield end end + + # We only want to cache request lists that have a reasonable chance of not expiring + # before they're requested again. Don't cache lists returned from specific searches + # or anything except the first page of results, just the first page of the default + # views + def request_list_cache_key + cacheable_param_list = ['controller', 'action', 'locale', 'view'] + if params.keys.all?{ |key| cacheable_param_list.include?(key) } + "request-list-#{@view}-#{@locale}" + else + nil + end + end end |