redis rack cache was crazy, it was just storing stuff in redis FOREVER, added a PR to fix, forked to my repo, sourcing a sane version
This commit is contained in:
parent
a64e04ca42
commit
68e6405aca
4
Gemfile
4
Gemfile
|
@ -134,7 +134,9 @@ gem 'lru_redux'
|
|||
gem 'rack-mini-profiler', require: false # require: false #, git: 'git://github.com/SamSaffron/MiniProfiler'
|
||||
|
||||
# used for caching, optional
|
||||
gem 'redis-rack-cache', require: false
|
||||
# redis-rack-cache is missing a sane expiry policy, it hogs redis
|
||||
# https://github.com/jodosha/redis-store/pull/183
|
||||
gem 'redis-rack-cache', :git => 'git@github.com:SamSaffron/redis-rack-cache.git', require: false
|
||||
gem 'rack-cache', require: false
|
||||
|
||||
gem 'rack-cors', require: false
|
||||
|
|
13
Gemfile.lock
13
Gemfile.lock
|
@ -46,6 +46,14 @@ GIT
|
|||
activerecord (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
|
||||
GIT
|
||||
remote: git@github.com:SamSaffron/redis-rack-cache.git
|
||||
revision: 379ef30e31d4e185cb1d7f8badca0cc06403eba2
|
||||
specs:
|
||||
redis-rack-cache (1.2.1)
|
||||
rack-cache (~> 1.2)
|
||||
redis-store (~> 1.1.0)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/rails-api/active_model_serializers.git
|
||||
revision: fe84e0ad5268f1439123fd9a1f9fd12e25a54cd3
|
||||
|
@ -350,9 +358,6 @@ GEM
|
|||
redis-rack (1.4.2)
|
||||
rack (~> 1.4.1)
|
||||
redis-store (~> 1.1.0)
|
||||
redis-rack-cache (1.2.1)
|
||||
rack-cache (~> 1.2)
|
||||
redis-store (~> 1.1.0)
|
||||
redis-rails (3.2.3)
|
||||
redis-actionpack (~> 3.2.3)
|
||||
redis-activesupport (~> 3.2.3)
|
||||
|
@ -504,7 +509,7 @@ DEPENDENCIES
|
|||
rb-inotify (~> 0.9)
|
||||
redcarpet
|
||||
redis
|
||||
redis-rack-cache
|
||||
redis-rack-cache!
|
||||
redis-rails
|
||||
rest-client
|
||||
rinku
|
||||
|
|
|
@ -2,6 +2,10 @@ if Rails.configuration.respond_to?(:enable_rack_cache) && Rails.configuration.en
|
|||
require 'rack-cache'
|
||||
require 'redis-rack-cache'
|
||||
|
||||
# by default we will cache up to 3 minutes in redis, if you want to cut down on redis usage
|
||||
# cut down this number
|
||||
RedisRackCache.max_cache_seconds = 60 * 3
|
||||
|
||||
url = DiscourseRedis.url
|
||||
|
||||
class Rack::Cache::Discourse < Rack::Cache::Context
|
||||
|
|
Loading…
Reference in New Issue