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/")
|
||||
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'/>
|
||||
<script src='#{path}'></script>".html_safe
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue