Commit 53350fb34f4bb430c01df430ebee6ab38a466ae4
1 parent
b4462f80
Exists in
staging
and in
42 other branches
Using cache_key instead of identifier to caches profile's page
(ActionItem1550)
Showing
3 changed files
with
6 additions
and
6 deletions
Show diff stats
app/models/person.rb
@@ -270,20 +270,20 @@ class Person < Profile | @@ -270,20 +270,20 @@ class Person < Profile | ||
270 | 270 | ||
271 | def communities_cache_key(params = {}) | 271 | def communities_cache_key(params = {}) |
272 | page = params[:npage] || '1' | 272 | page = params[:npage] || '1' |
273 | - identifier + '-communities-page-' + page | 273 | + cache_key + '-communities-page-' + page |
274 | end | 274 | end |
275 | 275 | ||
276 | def friends_cache_key(params = {}) | 276 | def friends_cache_key(params = {}) |
277 | page = params[:npage] || '1' | 277 | page = params[:npage] || '1' |
278 | - identifier + '-friends-page-' + page | 278 | + cache_key + '-friends-page-' + page |
279 | end | 279 | end |
280 | 280 | ||
281 | def manage_friends_cache_key(params = {}) | 281 | def manage_friends_cache_key(params = {}) |
282 | page = params[:npage] || '1' | 282 | page = params[:npage] || '1' |
283 | - identifier + '-manage-friends-page-' + page | 283 | + cache_key + '-manage-friends-page-' + page |
284 | end | 284 | end |
285 | 285 | ||
286 | def relationships_cache_key | 286 | def relationships_cache_key |
287 | - identifier + '-profile-relationships' | 287 | + cache_key + '-profile-relationships' |
288 | end | 288 | end |
289 | end | 289 | end |
app/models/profile.rb
@@ -680,7 +680,7 @@ private :generate_url, :url_options | @@ -680,7 +680,7 @@ private :generate_url, :url_options | ||
680 | 680 | ||
681 | def members_cache_key(params = {}) | 681 | def members_cache_key(params = {}) |
682 | page = params[:npage] || '1' | 682 | page = params[:npage] || '1' |
683 | - identifier + '-members-page-' + page | 683 | + cache_key + '-members-page-' + page |
684 | end | 684 | end |
685 | 685 | ||
686 | protected | 686 | protected |
app/views/profile/index.rhtml
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | <%= render :partial => partial_for_class(profile.class) %> | 16 | <%= render :partial => partial_for_class(profile.class) %> |
17 | 17 | ||
18 | <% unless @action %> | 18 | <% unless @action %> |
19 | - <% cache_timeout(profile.identifier + '-profile-general-info', 4.hours.from_now) do %> | 19 | + <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours.from_now) do %> |
20 | <tr> | 20 | <tr> |
21 | <th colspan='2'> | 21 | <th colspan='2'> |
22 | <%= _('Content') %> | 22 | <%= _('Content') %> |