aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-11 09:44:04 +0200
committerChocobozzz <me@florianbigard.com>2018-05-11 15:24:17 +0200
commitfd4484f19eae8b0a0c30d5d30e98880c8708516a (patch)
tree9dcb357413c84797b79e301fb843b1695e20d902 /server/initializers/constants.ts
parent8a2db2e8cb67f7f802ecb35be7b9154695f1a6ec (diff)
downloadPeerTube-fd4484f19eae8b0a0c30d5d30e98880c8708516a.tar.gz
PeerTube-fd4484f19eae8b0a0c30d5d30e98880c8708516a.tar.zst
PeerTube-fd4484f19eae8b0a0c30d5d30e98880c8708516a.zip
Cache AP video route for 5 seconds
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index c4e8522c2..cfa0203d2 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -42,6 +42,13 @@ const OAUTH_LIFETIME = {
42 REFRESH_TOKEN: 1209600 // 2 weeks 42 REFRESH_TOKEN: 1209600 // 2 weeks
43} 43}
44 44
45const ROUTE_CACHE_LIFETIME = {
46 FEEDS: 1000 * 60 * 15, // 15 minutes
47 ACTIVITY_PUB: {
48 VIDEOS: 1000 * 5 // 5 seconds
49 }
50}
51
45// --------------------------------------------------------------------------- 52// ---------------------------------------------------------------------------
46 53
47// Number of points we add/remove after a successful/bad request 54// Number of points we add/remove after a successful/bad request
@@ -413,8 +420,7 @@ const OPENGRAPH_AND_OEMBED_COMMENT = '<!-- open graph and oembed tags -->'
413// --------------------------------------------------------------------------- 420// ---------------------------------------------------------------------------
414 421
415const FEEDS = { 422const FEEDS = {
416 COUNT: 20, 423 COUNT: 20
417 CACHE_LIFETIME: 1000 * 60 * 15 // 15 minutes
418} 424}
419 425
420// --------------------------------------------------------------------------- 426// ---------------------------------------------------------------------------
@@ -458,6 +464,7 @@ export {
458 FOLLOW_STATES, 464 FOLLOW_STATES,
459 SERVER_ACTOR_NAME, 465 SERVER_ACTOR_NAME,
460 PRIVATE_RSA_KEY_SIZE, 466 PRIVATE_RSA_KEY_SIZE,
467 ROUTE_CACHE_LIFETIME,
461 SORTABLE_COLUMNS, 468 SORTABLE_COLUMNS,
462 FEEDS, 469 FEEDS,
463 NSFW_POLICY_TYPES, 470 NSFW_POLICY_TYPES,