backend: refactor server/nodeinfo.ts #221
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import config from '@/config/index.js';
|
|||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Users, Notes } from '@/models/index.js';
|
||||
import { Cache } from '@/misc/cache.js';
|
||||
import { MINUTE, SECOND } from '@/const.js';
|
||||
|
||||
const router = new Router();
|
||||
|
||||
|
@ -108,7 +109,7 @@ const nodeinfo2 = async (): Promise<NodeInfo2Base> => {
|
|||
};
|
||||
};
|
||||
|
||||
const cache = new Cache<NodeInfo2Base>(1000 * 60 * 10);
|
||||
const cache = new Cache<NodeInfo2Base>(10 * MINUTE);
|
||||
norm marked this conversation as resolved
Outdated
|
||||
|
||||
router.get(nodeinfo2_1path, async ctx => {
|
||||
const base = await cache.fetch(null, () => nodeinfo2());
|
||||
|
|
Loading…
Reference in a new issue
Is this cache even necessary? Maybe we should rely on the caching of the reverse proxy more.
Does the reverse proxy cache it by default?