Browse Source

Cache control

Bob Mottram 7 years ago
parent
commit
99013eedbc
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/freedombone-app-cryptpad

+ 5
- 0
src/freedombone-app-cryptpad View File

@@ -421,6 +421,11 @@ function install_cryptpad_main {
421 421
     echo '' >> $cryptpad_nginx_site
422 422
     echo '  index index.html;' >> $cryptpad_nginx_site
423 423
     echo '' >> $cryptpad_nginx_site
424
+    echo '  if ($args ~ ver=) {' >> $cryptpad_nginx_site
425
+    echo '      set $cacheControl max-age=31536000;' >> $cryptpad_nginx_site
426
+    echo '  }' >> $cryptpad_nginx_site
427
+    echo '  add_header Cache-Control $cacheControl;' >> $cryptpad_nginx_site
428
+    echo '' >> $cryptpad_nginx_site
424 429
     echo '  add_header X-XSS-Protection "1; mode=block";' >> $cryptpad_nginx_site
425 430
     echo '  add_header X-Content-Type-Options nosniff;' >> $cryptpad_nginx_site
426 431
     echo '  add_header X-Frame-Options SAMEORIGIN;' >> $cryptpad_nginx_site