From 5551676fef9d4477c3d7b0238bfdf736ae022fc7 Mon Sep 17 00:00:00 2001 From: Sam <sam.saffron@gmail.com> Date: Tue, 9 Dec 2014 14:49:02 +1100 Subject: [PATCH] FIX: cache all public resources registered by plugins. Plugins are responsible for expiry --- config/nginx.sample.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 434a3ec88b1..f13a987a125 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -58,7 +58,7 @@ server { # further more etags are based on the file in nginx not sha of data # use dates, it solves the problem fine even cross server etag off; - + # prevent direct download of backups location ^~ /backups/ { internal; @@ -79,9 +79,15 @@ server { # asset pipeline enables this gzip_static on; add_header Cache-Control public; + # TODO I don't think this break is needed, it just breaks out of rewrite break; } + location ~ ^/plugins/ { + expires 1y; + add_header Cache-Control public; + } + location ~ ^/uploads/ { # NOTE: it is really annoying that we can't just define headers