refactor: optimize favicon fetcher with cache

This commit is contained in:
Sonny
2024-05-26 00:19:47 +02:00
committed by Sonny
parent 9481b0ad7d
commit 8437f6b96d
6 changed files with 288 additions and 222 deletions

10
app/lib/cache.ts Normal file
View File

@@ -0,0 +1,10 @@
import { BentoCache, bentostore } from 'bentocache';
import { memoryDriver } from 'bentocache/drivers/memory';
export const cache = new BentoCache({
default: 'cache',
stores: {
cache: bentostore().useL1Layer(memoryDriver({ maxSize: 10_000 })),
},
});