Open robertovaldesperez opened 3 years ago
function configure() { localforage.defineDriver(memoryDriver) const forageStore = localforage.createInstance({ driver: [ localforage.INDEXEDDB, localforage.LOCALSTORAGE, memoryDriver._driver ], name: 'guru-cache' }) return setup({ baseURL: process.env.VUE_APP_BASE_API, timeout: 0, cache: { maxAge: 15 * 60 * 1000, store: forageStore, key: (req) => { return req.url + (req.data ? serializeQuery(req.data) : '') }, exclude: { query: false, filter: (req) => { return !req.readonly }, methods: ['patch', 'put', 'delete'] }, invalidate: async(cfg, req) => { if (!req.readonly) { await cfg.store.removeItem(cfg.uuid) } } } }) }
it is only caching get requests
it is only caching get requests