DEV: Introduce DISCOURSE_ASSET_URL_SALT (#24596)

This value is included when generating static asset URLs. Updating the value will allow site operators to invalidate all asset urls to recover from configuration issues which may have been cached by CDNs/browsers.
This commit is contained in:
David Taylor
2023-11-28 11:28:40 +00:00
committed by GitHub
parent 22ce638ec3
commit 5783f231f8
7 changed files with 29 additions and 5 deletions

View File

@ -22,7 +22,8 @@ class JavascriptCache < ActiveRecord::Base
end
def update_digest
self.digest = Digest::SHA1.hexdigest(content) if content_changed?
self.digest =
Digest::SHA1.hexdigest("#{content}|#{GlobalSetting.asset_url_salt}") if content_changed?
end
def content_cannot_be_nil