Skip to content

Commit

Permalink
Fix caching of browse categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Jan 19, 2017
1 parent 77199db commit a48910f
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 39 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ end

gem 'rubocop', '~> 0.41', '>= 0.41.2', require: false
gem 'blacklight', '6.7.3'
gem 'blacklight-spotlight', '0.31.0'
gem 'blacklight-spotlight', github: 'projectblacklight/spotlight', branch: :master
gem 'solr_wrapper'
gem 'rsolr', '~> 1.0.6'
gem 'devise'
Expand Down Expand Up @@ -96,3 +96,4 @@ gem 'riiif'
gem 'pul-assets', github: 'pulibrary/pul_assets'
gem 'spotlight-resources-iiif', github: 'pulibrary/spotlight-resources-iiif', branch: 'default_vocab'
gem 'newrelic_rpm'
gem 'dalli'
86 changes: 49 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ GIT
friendly_id (5.2.0.beta.1)
activerecord (>= 4.0.0)

GIT
remote: git://github.com/projectblacklight/spotlight.git
revision: cc8ed90bacab708d7a4989612cea067eff34a447
branch: master
specs:
blacklight-spotlight (0.31.0)
acts-as-taggable-on (>= 4.0.0.pre)
autoprefixer-rails
blacklight (~> 6.3)
blacklight-gallery (>= 0.3.0)
blacklight-oembed (>= 0.0.3)
bootstrap_form (~> 2.2)
breadcrumbs_on_rails (~> 2.3.0)
cancancan
carrierwave
carrierwave-crop
clipboard-rails (~> 1.5)
devise (>= 3.0)
devise_invitable (~> 1.6)
faraday
faraday_middleware
friendly_id (>= 5.2.0.beta.1, < 6)
github-markup
legato
mini_magick
nokogiri
oauth2
openseadragon
paper_trail (~> 5.0, >= 5.2.1)
rails (>= 4.2.0, < 6)
roar (~> 1.1)
roar-rails
signet
sir_trevor_rails (~> 0.5)
tophat
underscore-rails (~> 1.6)

GIT
remote: git://github.com/pulibrary/pul_assets.git
revision: 84dc633f5ff39167b4f7e7acf2517fffda630f0f
Expand Down Expand Up @@ -112,36 +149,6 @@ GEM
bootstrap-sass (~> 3.0)
rails
ruby-oembed
blacklight-spotlight (0.31.0)
acts-as-taggable-on (>= 4.0.0.pre)
autoprefixer-rails
blacklight (~> 6.3)
blacklight-gallery (>= 0.3.0)
blacklight-oembed (>= 0.0.3)
bootstrap_form (~> 2.2)
breadcrumbs_on_rails (~> 2.3.0)
cancancan
carrierwave
carrierwave-crop
clipboard-rails (~> 1.5)
devise (>= 3.0)
devise_invitable (~> 1.6)
faraday
faraday_middleware
friendly_id (>= 5.2.0.beta.1, < 6)
github-markup
legato
mini_magick
nokogiri
oauth2
openseadragon
paper_trail (~> 5.0, >= 5.2.1)
rails (>= 4.2.0, < 6)
roar-rails
signet
sir_trevor_rails (~> 0.5)
tophat
underscore-rails (~> 1.6)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
Expand Down Expand Up @@ -212,8 +219,11 @@ GEM
tins (>= 1.6.0, < 2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
dalli (2.7.6)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
declarative (0.0.8)
uber (>= 0.0.15)
deprecation (1.0.0)
activesupport
devise (4.2.0)
Expand All @@ -239,7 +249,7 @@ GEM
railties (>= 3.0.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.1)
faraday_middleware (0.11.0)
faraday (>= 0.7.4, < 1.0)
github-markup (1.4.0)
globalid (0.3.7)
Expand Down Expand Up @@ -377,15 +387,16 @@ GEM
redis (3.3.1)
redis-namespace (1.5.2)
redis (~> 3.0, >= 3.0.4)
representable (2.3.0)
uber (~> 0.0.7)
representable (3.0.2)
declarative (~> 0.0.5)
uber (>= 0.0.15, < 0.2.0)
request_store (1.3.2)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
riiif (0.4.1)
rails (> 3.2.0)
roar (1.0.4)
representable (>= 2.0.1, < 2.4.0)
roar (1.1.0)
representable (~> 3.0.0)
roar-rails (1.0.1)
actionpack
railties (>= 3.0.0)
Expand Down Expand Up @@ -516,7 +527,7 @@ GEM
railties (>= 3.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.15)
uber (0.1.0)
uglifier (3.0.2)
execjs (>= 0.3.0, < 3)
underscore-rails (1.8.3)
Expand Down Expand Up @@ -550,14 +561,15 @@ DEPENDENCIES
blacklight (= 6.7.3)
blacklight-gallery (>= 0.3.0)
blacklight-oembed
blacklight-spotlight (= 0.31.0)
blacklight-spotlight!
byebug
capistrano-passenger
capistrano-rails
capistrano-rails-console
capybara
coffee-rails (~> 4.1.0)
coveralls
dalli
database_cleaner
devise
devise-guests (~> 0.3)
Expand Down
11 changes: 11 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@
end
end
end
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, 'cache:clear'
end
end
end
end
end
after 'deploy:reverted', 'sneakers:restart'
after 'deploy:published', 'sneakers:restart'
after 'deploy:starting', 'sidekiq:quiet'
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
Expand Down
7 changes: 7 additions & 0 deletions lib/tasks/clear_cache.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
desc "Clear rails cache"
namespace :cache do
task clear: :environment do
puts "Clearing Rails cache"
Rails.cache.clear
end
end

0 comments on commit a48910f

Please sign in to comment.