redis缓存服务器的搭建以及对首页的缓存设置
Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
parent
5c67cfc6b6
commit
54078e114c
2
Gemfile
2
Gemfile
|
@ -23,6 +23,8 @@ gem "builder", "3.0.0"
|
|||
gem 'acts-as-taggable-on', '2.4.1'
|
||||
gem 'spreadsheet'
|
||||
gem 'ruby-ole'
|
||||
gem 'redis'
|
||||
gem 'redis-store'
|
||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
|
|
|
@ -19,7 +19,7 @@ class WelcomeController < ApplicationController
|
|||
include ApplicationHelper
|
||||
include WelcomeHelper
|
||||
helper :project_score
|
||||
caches_action :robots
|
||||
caches_action :robots, :course, :contest, :index, expires_in: 2.hours, layout: false
|
||||
#before_filter :find_first_page, :only => [:index]
|
||||
# before_filter :fake, :only => [:index, :course]
|
||||
before_filter :entry_select, :only => [:index]
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
# Copy this file to additional_environment.rb and add any statements
|
||||
# that need to be passed to the Rails::Initializer. `config` is
|
||||
# available in this context.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# config.log_level = :debug
|
||||
# ...
|
||||
#
|
||||
|
|
@ -10,9 +10,9 @@ RedmineApp::Application.configure do
|
|||
config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
#config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
|
||||
config.cache_store = :dalli_store
|
||||
config.action_controller.perform_caching = true
|
||||
config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
|
||||
#config.cache_store = :dalli_store
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$redis = Redis.new(:host => "127.0.0.1", :port => 6379)
|
17
db/schema.rb
17
db/schema.rb
|
@ -438,13 +438,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "documents", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.integer "category_id", :default => 0, :null => false
|
||||
|
@ -654,16 +647,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
|
|||
|
||||
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
||||
|
||||
create_table "journal_details_copy", :force => true do |t|
|
||||
t.integer "journal_id", :default => 0, :null => false
|
||||
t.string "property", :limit => 30, :default => "", :null => false
|
||||
t.string "prop_key", :limit => 30, :default => "", :null => false
|
||||
t.text "old_value"
|
||||
t.text "value"
|
||||
end
|
||||
|
||||
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
|
||||
|
||||
create_table "journal_replies", :id => false, :force => true do |t|
|
||||
t.integer "journal_id"
|
||||
t.integer "user_id"
|
||||
|
|
Loading…
Reference in New Issue