mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Extend custom CSS cache time with digest paths (#33207)
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user