From 78272ae4cdeae0dc3126dcd6b41b54ccc275c61d Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 17 Aug 2019 11:52:35 +0200 Subject: [PATCH] Added caching to the docker image --- README.md | 4 ++++ nginx.conf | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index ea29dd2a..1e30c641 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ This is the web frontend for Vikunja, written in Vue.js. +## Docker + +There is a [docker image available](https://hub.docker.com/r/vikunja/api) with support for http/2 and aggressive caching enabled. + ## Project setup ``` yarn install diff --git a/nginx.conf b/nginx.conf index 1126ab4d..e0e517a4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -36,6 +36,15 @@ http { gzip_min_length 256; gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml font/woff2 text/html image/x-icon; + # Expires map + map $sent_http_content_type $expires { + default off; + text/html epoch; # We don't cache the html for the browser to get the content + text/css max; + application/javascript max; + ~image/ max; + } + server { listen 80; listen 81 default_server http2 proxy_protocol; ## Needed when behind HAProxy with SSL termination + HTTP/2 support @@ -43,6 +52,8 @@ http { server_name _; + expires $expires; + ssl_certificate /etc/nginx/ssl/dummy.crt; ssl_certificate_key /etc/nginx/ssl/dummy.key;