Optimization:Move Initialization CacheBust to Background Worker (#10311)
* Optimization:Move Initilization CacheBust to Background Worker * lower cache bust to 5 min and then bust shell version last * moving back to 10 min after looking at recent deploy data
This commit is contained in:
parent
1a531bca0e
commit
cc694146e6
4 changed files with 15 additions and 8 deletions
|
|
@ -1,8 +0,0 @@
|
|||
# Trigger cache purges for globally-cached endpoints that could have changed
|
||||
CacheBuster.bust("/shell_top")
|
||||
CacheBuster.bust("/shell_bottom")
|
||||
CacheBuster.bust("/async_info/shell_version")
|
||||
CacheBuster.bust("/onboarding")
|
||||
|
||||
# We will set RELEASE_FOOTPRINT in our Forem Cloud environment, or use HEROKU_SLUG_COMMIT if set (e.g. Heroku env)
|
||||
ENV["RELEASE_FOOTPRINT"] ||= ENV["HEROKU_SLUG_COMMIT"]
|
||||
2
config/initializers/set_release_footprint.rb
Normal file
2
config/initializers/set_release_footprint.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# We will set RELEASE_FOOTPRINT in our Forem Cloud environment, or use HEROKU_SLUG_COMMIT if set (e.g. Heroku env)
|
||||
ENV["RELEASE_FOOTPRINT"] ||= ENV["HEROKU_SLUG_COMMIT"]
|
||||
|
|
@ -10,6 +10,9 @@ namespace :app_initializer do
|
|||
puts "\n== Updating Data =="
|
||||
Rake::Task["data_updates:enqueue_data_update_worker"].execute
|
||||
|
||||
puts "\n== Bust Caches =="
|
||||
Rake::Task["cache:enqueue_path_bust_workers"].execute
|
||||
|
||||
SiteConfig.health_check_token ||= SecureRandom.hex(10)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
10
lib/tasks/cache.rake
Normal file
10
lib/tasks/cache.rake
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace :cache do
|
||||
desc "Enqueue BustCachePathWorker"
|
||||
task enqueue_path_bust_workers: :environment do
|
||||
# Trigger cache purges for globally-cached endpoints that could have changed
|
||||
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/shell_top")
|
||||
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/shell_bottom")
|
||||
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/onboarding")
|
||||
BustCachePathWorker.set(queue: :high_priority).perform_in(10.minutes, "/async_info/shell_version")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue