/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
test/e2e/app-dir/app-custom-cache-handler/cache-handler.js
27 строк
564 B
Jiachi Liu
Allow using ESM pkg with custom incremental cache (#59863)
03 янв 2024, 16:22
Не верифицирован
03 янв 2024, 16:22
7818c2d
Код
Авторство
О чём код?
const cache = new Map() class CacheHandler { constructor(options) { this.options = options this.cache = {} console.log('initialized custom cache-handler') console.log('cache handler - cjs module exports') } async get(key) { console.log('key', key) console.log('cache-handler get', key) return cache.get(key) } async set(key, data) { console.log('set key', key) console.log('cache-handler set', key) cache.set(key, { value: data, lastModified: Date.now(), }) } } module.exports = CacheHandler