diff --git a/assets/javascripts/models/doc.coffee b/assets/javascripts/models/doc.coffee index daebd43b..03c799c6 100644 --- a/assets/javascripts/models/doc.coffee +++ b/assets/javascripts/models/doc.coffee @@ -28,7 +28,7 @@ class app.models.Doc extends app.Model "#{app.config.docs_host}#{@fullPath(path)}" indexUrl: -> - "#{app.indexHost()}/#{@index_path}" + "#{app.indexHost()}/#{@index_path}?#{@mtime}" toEntry: -> new app.models.Entry diff --git a/lib/app.rb b/lib/app.rb index 9b5e9ed3..db5a8831 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -63,7 +63,7 @@ class App < Sinatra::Application root: 'public', urls: %w(/assets /docs /images /favicon.ico /robots.txt /opensearch.xml /manifest.webapp), header_rules: [ - [:all, {'Cache-Control' => 'private, max-age=0'}], + [:all, {'Cache-Control' => 'no-cache, max-age=0'}], ['/assets', {'Cache-Control' => 'public, max-age=604800'}], ['/favicon.ico', {'Cache-Control' => 'public, max-age=86400'}], ['/images', {'Cache-Control' => 'public, max-age=86400'}] ] @@ -96,7 +96,7 @@ class App < Sinatra::Application cookie.split('/').inject [] do |result, slug| if doc = settings.docs[slug] - result << File.join('', settings.docs_prefix, doc['index_path']) + result << File.join('', settings.docs_prefix, doc['index_path']) + "?#{doc['mtime']}" end result end @@ -113,7 +113,7 @@ class App < Sinatra::Application get '/manifest.appcache' do content_type 'text/cache-manifest' - expires 0, :private + expires 0, :'no-cache' erb :manifest end