Skip to content

Instantly share code, notes, and snippets.

View noluckjustskill's full-sized avatar

EscOFF noluckjustskill

View GitHub Profile
@Tuarisa
Tuarisa / nuxt-axios-cache.js
Last active October 3, 2021 21:28
Nuxt axios cache plugin
import hash from 'object-hash'
import sizeof from 'object-sizeof'
import lruCache from 'lru-cache'
const cacheEnabled = true
const cacheMaxAge = 30 * 60 * 1000
const cacheMaxSize = 128 * 1000 * 1000
const getCacheKey = obj => hash(obj)