Skip to content

A platform for community discussion. Free, open, simple.

DEV: add cache breaker for development

Samaa6b77914760
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index cfc0006677c..696a2a870a6 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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