cache just content on items, not action, so we can still use title and canonical
This commit is contained in:
parent
183430adb6
commit
3b7f158890
3 changed files with 40 additions and 38 deletions
|
@ -1,6 +1,5 @@
|
|||
class ItemsController < ApplicationController
|
||||
before_filter :set_query
|
||||
caches_action :show, :layout => false
|
||||
|
||||
def index
|
||||
if params.has_key?(:q)
|
||||
|
@ -61,3 +60,4 @@ class ItemsController < ApplicationController
|
|||
@query = params[:q]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
- content_for :meta do
|
||||
%link{:rel => 'canonical', :href => url_for(@item)}
|
||||
|
||||
- cache "items_show_#{@item.id}_main_content" do
|
||||
%header
|
||||
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
|
||||
%div
|
||||
|
|
|
@ -9,3 +9,4 @@
|
|||
= submit_tag 'Search', :name => nil
|
||||
= yield
|
||||
= render :file => 'layouts/application'
|
||||
|
||||
|
|
Loading…
Reference in a new issue