mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
DEV: add cache breaker for development
Previously iOS could cache scripts (wrongly) which made debugging very hard
This commit is contained in:
parent
9c6cf9eb14
commit
aa6b779147
@ -75,6 +75,13 @@ module ApplicationHelper
|
|||||||
path.gsub!("#{GlobalSetting.cdn_url}/assets/", "#{GlobalSetting.cdn_url}/brotli_asset/")
|
path.gsub!("#{GlobalSetting.cdn_url}/assets/", "#{GlobalSetting.cdn_url}/brotli_asset/")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Rails.env == "development"
|
||||||
|
if !path.include?("?")
|
||||||
|
# cache breaker for mobile iOS
|
||||||
|
path = path + "?#{Time.now.to_f}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
"<link rel='preload' href='#{path}' as='script'/>
|
"<link rel='preload' href='#{path}' as='script'/>
|
||||||
<script src='#{path}'></script>".html_safe
|
<script src='#{path}'></script>".html_safe
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user