Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wiki 页面加入 etag;

  • Loading branch information...
commit 3968dfd2e6a2d241c57c65e0b1ae13a3564f62c3 1 parent ec1c104
@huacnlee huacnlee authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/controllers/pages_controller.rb
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.