no browser cache for dashboard and text editor

This commit is contained in:
Kyle Drake 2016-04-06 20:23:48 -07:00
parent b15f1aab1d
commit 4d223e356e
4 changed files with 13 additions and 0 deletions

View file

@ -1,6 +1,7 @@
get '/dashboard' do get '/dashboard' do
require_login require_login
dashboard_init dashboard_init
dont_browser_cache
unless current_site.dashboard_accessed unless current_site.dashboard_accessed
current_site.dashboard_accessed = true current_site.dashboard_accessed = true

View file

@ -160,6 +160,8 @@ end
get %r{\/site_files\/text_editor\/(.+)} do get %r{\/site_files\/text_editor\/(.+)} do
require_login require_login
dont_browser_cache
@filename = params[:captures].first @filename = params[:captures].first
extname = File.extname @filename extname = File.extname @filename
@ace_mode = case extname @ace_mode = case extname

View file

@ -112,3 +112,7 @@ def plan_pricing_button(plan_type)
%{<a data-plan_name="#{Site::PLAN_FEATURES[plan_type.to_sym][:name]}" data-plan_type="#{plan_type}" data-plan_price="#{plan_price}" onclick="card = new Skeuocard($('#skeuocard')); return false" class="btn-Action planPricingButton">#{button_title}</a>} %{<a data-plan_name="#{Site::PLAN_FEATURES[plan_type.to_sym][:name]}" data-plan_type="#{plan_type}" data-plan_price="#{plan_price}" onclick="card = new Skeuocard($('#skeuocard')); return false" class="btn-Action planPricingButton">#{button_title}</a>}
end end
end end
def dont_browser_cache
@dont_browser_cache = true
end

View file

@ -23,6 +23,12 @@
<meta name="MobileOptimized" content="320"> <meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1"> <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1">
<% if @dont_browser_cache %>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<% end %>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script type="text/javascript" src="/js/html5.min.js"></script> <script type="text/javascript" src="/js/html5.min.js"></script>
<![endif]--> <![endif]-->