diff --git a/cmd/nginx/podsync.conf b/cmd/nginx/podsync.conf index 77b03da..b547f4c 100644 --- a/cmd/nginx/podsync.conf +++ b/cmd/nginx/podsync.conf @@ -37,6 +37,28 @@ http { root /var/www/podsync/; index index.html; + # Cache media: images, icons, video, audio, HTC + # See https://serversforhackers.com/c/nginx-caching + location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { + expires 3M; + access_log off; + add_header Cache-Control "public"; + } + + # Cache CSS and Javascript + location ~* \.(?:css|js)$ { + expires 1y; + access_log off; + add_header Cache-Control "public"; + } + + # Cache fonts + location ~* \.(?:ttf|woff|woff2|eot|otf)$ { + expires 1y; + access_log off; + add_header Cache-Control "public"; + } + location /nginx-ping { access_log off; return 200 "pong\n"; diff --git a/cmd/nginx/robots.txt b/cmd/nginx/robots.txt index 1f3acf5..36c1763 100644 --- a/cmd/nginx/robots.txt +++ b/cmd/nginx/robots.txt @@ -1,5 +1,9 @@ User-agent: * Allow: /$ -Allow: /faq.html +Allow: /*.js +Allow: /*.css +Allow: /faq +Allow: /assets/* +Allow: /fontawesome-webfont* Disallow: / Host: www.podsync.net \ No newline at end of file diff --git a/ui/src/app/index/index.component.html b/ui/src/app/index/index.component.html index d4258cb..54668bb 100644 --- a/ui/src/app/index/index.component.html +++ b/ui/src/app/index/index.component.html @@ -34,7 +34,7 @@
- + Become my patron on Patreon