From 25e030a7074f8e00cfbdaf85e491b9b22886991d Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 11 Sep 2023 14:55:18 +0900 Subject: enhance(frontend): improve some caches --- packages/frontend/src/cache.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/frontend/src/cache.ts') diff --git a/packages/frontend/src/cache.ts b/packages/frontend/src/cache.ts index 3523d4406b..1f3d28ba57 100644 --- a/packages/frontend/src/cache.ts +++ b/packages/frontend/src/cache.ts @@ -5,8 +5,9 @@ import * as Misskey from 'misskey-js'; import { Cache } from '@/scripts/cache'; +import { api } from '@/os'; -export const clipsCache = new Cache(Infinity); -export const rolesCache = new Cache(Infinity); -export const userListsCache = new Cache(Infinity); -export const antennasCache = new Cache(Infinity); +export const clipsCache = new Cache(1000 * 60 * 30, () => api('clips/list')); +export const rolesCache = new Cache(1000 * 60 * 30, () => api('admin/roles/list')); +export const userListsCache = new Cache(1000 * 60 * 30, () => api('users/lists/list')); +export const antennasCache = new Cache(1000 * 60 * 30, () => api('antennas/list')); -- cgit v1.2.3-freya