From 414f3844aba5b92cd0c7a1e7e972d3e2838aeb78 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 10 Sep 2017 10:29:57 -0400 Subject: [PATCH] Update HTTP caching rules --- lib/app.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/app.rb b/lib/app.rb index 45d08270..15f1e3c8 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -76,11 +76,16 @@ class App < Sinatra::Application root: 'public', urls: %w(/assets /docs/ /images /favicon.ico /robots.txt /opensearch.xml /mathml.css /manifest.json), header_rules: [ - [:all, {'Cache-Control' => 'no-cache, max-age=0'}], - ['/assets', {'Cache-Control' => 'public, max-age=604800'}], - ['/favicon.ico', {'Cache-Control' => 'public, max-age=86400'}], - ['/mathml.css', {'Cache-Control' => 'public, max-age=604800'}], - ['/images', {'Cache-Control' => 'public, max-age=86400'}] ] + [:all, { 'Cache-Control' => 'no-cache, max-age=0' }], + ['/assets', { 'Cache-Control' => 'public, max-age=604800' }], + ['/docs', { 'Cache-Control' => 'public, max-age=86400' }], + ['/images', { 'Cache-Control' => 'public, max-age=86400' }], + ['/favicon.ico', { 'Cache-Control' => 'public, max-age=86400' }], + ['/robots.txt', { 'Cache-Control' => 'public, max-age=86400' }], + ['/opensearch.xml', { 'Cache-Control' => 'public, max-age=86400' }], + ['/mathml.css', { 'Cache-Control' => 'public, max-age=86400' }], + ['/manifest.json', { 'Cache-Control' => 'public, max-age=86400' }] + ] sprockets.js_compressor = Uglifier.new output: { beautify: true, indent_level: 0 } sprockets.css_compressor = :sass