diff --git a/.github/readme/partials/setup/shared.md b/.github/readme/partials/setup/shared.md index 4d334231..09308ae8 100644 --- a/.github/readme/partials/setup/shared.md +++ b/.github/readme/partials/setup/shared.md @@ -12,10 +12,12 @@ This is mostly intended for previews, to enjoy all features consider using GitHu 💬 Fair use To ensure service availability, shared instance has a few limitations: - * Images are cached for 1 hour + * Images are cached for 15 minutes * Rendered metrics **won't be updated** during this time window when queried * You can manually update rendering againg your metrics on [metrics.lecoq.io](https://metrics.lecoq.io) - * There is a rate limiter enabled (it doesn't affect already cached metrics) - * Several plugins may not be available + * A rate limiter is enabled to prevent denial of service (it doesn't affect already cached metrics) + * Some plugins may not be available + +Service is provided free of charge, so please be gentle with it 🙂 diff --git a/source/app/web/instance.mjs b/source/app/web/instance.mjs index 8ffe8b04..c41cd10f 100644 --- a/source/app/web/instance.mjs +++ b/source/app/web/instance.mjs @@ -69,7 +69,7 @@ } //Cache headers middleware middlewares.push((req, res, next) => { - res.header("Cache-Control", cached ? `public, max-age=${cached}` : "no-store, no-cache") + res.header("Cache-Control", cached ? `public, max-age=${Math.round(cached/1000)}` : "no-store, no-cache") next() })