DEV: Add a helper method to clear every possible theme cache (#17585)

Our theme system is very complex and it can take a while to figure out how to invalidate the various types of caches that are used throughout the theme system. So, having a single helper method that invalidates everything can be useful in emergency situations where there is no time to read through the code and figure out how to clear the various caches.

Internal ticket: t64732.
This commit is contained in:
Osama Sayegh
2022-07-22 09:46:52 +03:00
committed by GitHub
parent cf5e59928e
commit 306dca3a48
3 changed files with 136 additions and 3 deletions

View File

@@ -151,9 +151,6 @@ class Theme < ActiveRecord::Base
end
Theme.expire_site_cache!
ColorScheme.hex_cache.clear
CSP::Extension.clear_theme_extensions_cache!
SvgSprite.expire_cache
end
def self.compiler_version
@@ -217,6 +214,8 @@ class Theme < ActiveRecord::Base
clear_cache!
ApplicationSerializer.expire_cache_fragment!("user_themes")
ColorScheme.hex_cache.clear
CSP::Extension.clear_theme_extensions_cache!
SvgSprite.expire_cache
end
def self.clear_default!