]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Improve static files cache
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index 40f86a30d07c00a87801978c7a437302270d93c6..5fe7d416c0b4be8db2a95dea40d23ac419c9ffb2 100644 (file)
@@ -500,7 +500,10 @@ const STATIC_DOWNLOAD_PATHS = {
 }
 
 // Cache control
-let STATIC_MAX_AGE = '2h'
+let STATIC_MAX_AGE = {
+  SERVER: '2h',
+  CLIENT: '30d'
+}
 
 // Videos thumbnail size
 const THUMBNAILS_SIZE = {
@@ -604,7 +607,7 @@ if (isTestInstance() === true) {
   REMOTE_SCHEME.HTTP = 'http'
   REMOTE_SCHEME.WS = 'ws'
 
-  STATIC_MAX_AGE = '0'
+  STATIC_MAX_AGE.SERVER = '0'
 
   ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE = 2
   ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds