Permalink
Browse files

Wiki 页面加入 etag;

  • Loading branch information...
huacnlee committed Dec 14, 2012
1 parent ec1c104 commit 3968dfd2e6a2d241c57c65e0b1ae13a3564f62c3
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/controllers/pages_controller.rb
@@ -9,12 +9,16 @@ class PagesController < ApplicationController
def index
set_seo_meta("Wiki")
drop_breadcrumb("索引")
+
+ fresh_when(:etag => [SiteConfig.wiki_index_html])
end
def recent
@pages = Page.recent.paginate(:page => params[:page], :per_page => 30)
set_seo_meta t("pages.wiki_index")
drop_breadcrumb t("common.index")
+
+ fresh_when(:etag => [@pages])
end
def show
@@ -29,6 +33,8 @@ def show
set_seo_meta("#{@page.title} - Wiki")
drop_breadcrumb("查看 #{@page.title}")
end
+
+ fresh_when(:etag => [@page,@page.comments_count])
end
def comments

0 comments on commit 3968dfd

Please sign in to comment.