Extend custom CSS cache time with digest paths (#33207)
This commit is contained in:
parent
b3243ef41c
commit
c0264c8013
11 changed files with 142 additions and 6 deletions
18
config/initializers/settings_digests.rb
Normal file
18
config/initializers/settings_digests.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Rails.application.config.to_prepare do
|
||||
custom_css = begin
|
||||
Setting.custom_css
|
||||
rescue ActiveRecord::AdapterError # Running without a database, not migrated, no connection, etc
|
||||
nil
|
||||
end
|
||||
|
||||
if custom_css.present?
|
||||
Rails
|
||||
.cache
|
||||
.write(
|
||||
:setting_digest_custom_css,
|
||||
Digest::SHA256.hexdigest(custom_css)
|
||||
)
|
||||
end
|
||||
end
|
|
@ -55,7 +55,8 @@ Rails.application.routes.draw do
|
|||
|
||||
get 'manifest', to: 'manifests#show', defaults: { format: 'json' }
|
||||
get 'intent', to: 'intents#show'
|
||||
get 'custom.css', to: 'custom_css#show', as: :custom_css
|
||||
get 'custom.css', to: 'custom_css#show'
|
||||
resources :custom_css, only: :show, path: :css
|
||||
|
||||
get 'remote_interaction_helper', to: 'remote_interaction_helper#index'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue