PERF: cache path for svg-sprite in upcoming FA5

PERF: cache path for svg-sprite in upcoming FA5

We need to make sure NGINX caches all paths for SVG assets,
this ensures only the first request for an svg sprite ever hits the app

From 1824ac9d390295453aae16ad5d72528580ad498a Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Mon, 19 Nov 2018 10:34:16 +1100
Subject: [PATCH] PERF: cache path for svg-sprite in upcoming FA5

We need to make sure NGINX caches all paths for SVG assets,
this ensures only the first request for an svg sprite ever hits the app

diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf
index f22dc22..48bb7a3 100644
--- a/config/nginx.sample.conf
+++ b/config/nginx.sample.conf
@@ -191,7 +191,7 @@ server {
     # This big block is needed so we can selectively enable
     # acceleration for backups and avatars
     # see note about repetition above
-    location ~ ^/(letter_avatar/|user_avatar|highlight-js|stylesheets|theme-javascripts|favicon/proxied|service-worker) {
+    location ~ ^/(svg-sprite/|letter_avatar/|user_avatar|highlight-js|stylesheets|theme-javascripts|favicon/proxied|service-worker) {
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Request-Start "t=${msec}";

GitHub

1 Like