redis缓存服务器的搭建以及对首页的缓存设置

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-05-04 15:20:40 +08:00
parent 5c67cfc6b6
commit 54078e114c
6 changed files with 7 additions and 31 deletions

View File

@ -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'

View File

@ -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]

View File

@ -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
# ...
#

View File

@ -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

View File

@ -0,0 +1 @@
$redis = Redis.new(:host => "127.0.0.1", :port => 6379)

View File

@ -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"