缓存修改为redis存储

This commit is contained in:
guange 2015-04-22 13:01:33 +08:00
parent d2dd77612b
commit 336dba414e
5 changed files with 8 additions and 13 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.swp
/config/database.yml
/config/configuration.yml
/config/additional_environment.rb
/files/*
/log/*
/public/tmp/*

View File

@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv'
end
gem 'redis-rails'
gem 'rubyzip'
gem 'delayed_job_active_record'#, :group => :production
gem 'daemons'

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
# ...
#
#config.relative_url_root = '/socialforge'

View File

@ -67,8 +67,6 @@ module RedmineApp
# Do not include all helpers
config.action_controller.include_all_helpers = false
config.session_store :cookie_store, :key => '_redmine_session'
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
end

View File

@ -19,7 +19,12 @@ RedmineApp::Application.configure do
# Full error reports are disabled and caching is turned on
config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly
config.action_controller.perform_caching = true
config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
# to additional_environment.rb
# config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
# config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes }
#
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"