Fix Firefox buggy appcache

pull/142/merge
Thibaut 10 years ago
parent e4ac0e8757
commit d8cdda54b5

@ -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

@ -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

Loading…
Cancel
Save