From c9bf84c5021a0e9523ea186fcae69c9a9001f079 Mon Sep 17 00:00:00 2001 From: chris48s Date: Wed, 6 Dec 2023 18:31:45 +0000 Subject: [PATCH] cache some badges for longer --- services/bundlephobia/bundlephobia.service.js | 2 ++ services/discord/discord.service.js | 2 +- services/opencollective/opencollective-all.service.js | 2 +- services/opencollective/opencollective-backers.service.js | 2 +- services/opencollective/opencollective-sponsors.service.js | 2 +- services/pypi/pypi-downloads.service.js | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/bundlephobia/bundlephobia.service.js b/services/bundlephobia/bundlephobia.service.js index 68ac512620900..26a9cd77e0e91 100644 --- a/services/bundlephobia/bundlephobia.service.js +++ b/services/bundlephobia/bundlephobia.service.js @@ -65,6 +65,8 @@ export default class Bundlephobia extends BaseJsonService { }, ] + static _cacheLength = 900 + static defaultBadgeData = { label: 'bundlephobia', color: 'informational' } static render({ format, size }) { diff --git a/services/discord/discord.service.js b/services/discord/discord.service.js index b5c4809f89d18..50d44d23b27af 100644 --- a/services/discord/discord.service.js +++ b/services/discord/discord.service.js @@ -49,7 +49,7 @@ export default class Discord extends BaseJsonService { }, } - static _cacheLength = 60 + static _cacheLength = 300 static defaultBadgeData = { label: 'chat' } diff --git a/services/opencollective/opencollective-all.service.js b/services/opencollective/opencollective-all.service.js index d9e406a7da592..174ef58fd71be 100644 --- a/services/opencollective/opencollective-all.service.js +++ b/services/opencollective/opencollective-all.service.js @@ -16,7 +16,7 @@ export default class OpencollectiveAll extends OpencollectiveBase { }, } - static _cacheLength = 1800 + static _cacheLength = 3600 static defaultBadgeData = { label: 'backers and sponsors', diff --git a/services/opencollective/opencollective-backers.service.js b/services/opencollective/opencollective-backers.service.js index e54094e151961..0565e097bb385 100644 --- a/services/opencollective/opencollective-backers.service.js +++ b/services/opencollective/opencollective-backers.service.js @@ -16,7 +16,7 @@ export default class OpencollectiveBackers extends OpencollectiveBase { }, } - static _cacheLength = 1800 + static _cacheLength = 3600 static defaultBadgeData = { label: 'backers', diff --git a/services/opencollective/opencollective-sponsors.service.js b/services/opencollective/opencollective-sponsors.service.js index f8faf78e87a2c..192d5f4bef420 100644 --- a/services/opencollective/opencollective-sponsors.service.js +++ b/services/opencollective/opencollective-sponsors.service.js @@ -16,7 +16,7 @@ export default class OpencollectiveSponsors extends OpencollectiveBase { }, } - static _cacheLength = 1800 + static _cacheLength = 3600 static defaultBadgeData = { label: 'sponsors', diff --git a/services/pypi/pypi-downloads.service.js b/services/pypi/pypi-downloads.service.js index 2783a70ea88a3..da52c0300bc6b 100644 --- a/services/pypi/pypi-downloads.service.js +++ b/services/pypi/pypi-downloads.service.js @@ -53,7 +53,7 @@ export default class PypiDownloads extends BaseJsonService { }, ] - static _cacheLength = 21600 + static _cacheLength = 28800 static defaultBadgeData = { label: 'downloads' }