Improve nginx client images cache
authorChocobozzz <me@florianbigard.com>
Mon, 29 Jul 2019 12:58:41 +0000 (14:58 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 29 Jul 2019 12:58:41 +0000 (14:58 +0200)
shared/extra-utils/miscs/miscs.ts
support/nginx/peertube

index 08f41a7e7503ef564fb0d69d35bd9787dc3e3b0e..ae8a26c98d0a91939e2995c8eff59cda143097dd 100644 (file)
@@ -64,7 +64,11 @@ function buildAbsoluteFixturePath (path: string, customCIPath = false) {
     return path
   }
 
-  if (customCIPath && process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path)
+  if (customCIPath) {
+    if (process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path)
+
+    if (process.env.TRAVIS) return join(process.env.HOME, 'fixtures', path)
+  }
 
   return join(root(), 'server', 'tests', 'fixtures', path)
 }
index fee0f5d1c09144460ee6c97b6aa9660f51cd18b5..aca9857858ea459b02eb1fa103faebfe69052db7 100644 (file)
@@ -59,7 +59,7 @@ server {
   }
 
   # Bypass PeerTube for performance reasons. Could be removed
-  location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ {
+  location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ {
     add_header Cache-Control "public, max-age=31536000, immutable";
 
     alias /var/www/peertube/peertube-latest/client/dist/$1;