diff options
-rw-r--r-- | server/controllers/static.ts | 2 | ||||
-rw-r--r-- | server/initializers/constants.ts | 2 | ||||
-rw-r--r-- | support/nginx/peertube | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 1600068e0..8de9c5a78 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -31,7 +31,7 @@ const videosPhysicalPath = CONFIG.STORAGE.VIDEOS_DIR | |||
31 | staticRouter.use( | 31 | staticRouter.use( |
32 | STATIC_PATHS.WEBSEED, | 32 | STATIC_PATHS.WEBSEED, |
33 | cors(), | 33 | cors(), |
34 | express.static(videosPhysicalPath, { maxAge: STATIC_MAX_AGE }) | 34 | express.static(videosPhysicalPath) |
35 | ) | 35 | ) |
36 | staticRouter.use( | 36 | staticRouter.use( |
37 | STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', | 37 | STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 3837f7062..b11f0753f 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -429,7 +429,7 @@ const STATIC_DOWNLOAD_PATHS = { | |||
429 | } | 429 | } |
430 | 430 | ||
431 | // Cache control | 431 | // Cache control |
432 | let STATIC_MAX_AGE = '30d' | 432 | let STATIC_MAX_AGE = '2h' |
433 | 433 | ||
434 | // Videos thumbnail size | 434 | // Videos thumbnail size |
435 | const THUMBNAILS_SIZE = { | 435 | const THUMBNAILS_SIZE = { |
diff --git a/support/nginx/peertube b/support/nginx/peertube index 0e77f6ae4..f28f26f7a 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -57,7 +57,8 @@ server { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | location ~ ^/static/(thumbnails|avatars)/(.*)$ { | 59 | location ~ ^/static/(thumbnails|avatars)/(.*)$ { |
60 | add_header Cache-Control "public, max-age=31536000, immutable"; | 60 | # Cache 2 hours |
61 | add_header Cache-Control "public, max-age=7200"; | ||
61 | 62 | ||
62 | alias /var/www/peertube/storage/$1/$2; | 63 | alias /var/www/peertube/storage/$1/$2; |
63 | } | 64 | } |