Module

api-wrapper-cache

Client side cache for API requests (get/post)

View Source api/api-cache.js, line 1

Requires

  • module:vue-local-storage.js

Methods

# static getCachedJWT()

Tries to grab JWT from cache (two tries with 1s difference)

View Source api/api-cache.js, line 22

# static getCacheFromAPIRequestURL(url) → {Object}

Will retrieve a cached API response per URL+JWT if available (not expired)

Parameters:
Name Type Description
url *
options.beforeCacheFetch function

Will skip cache if false (Boolean)

View Source api/api-cache.js, line 107

Object

# static setCacheFromAPIResponse(res)

Will cache API response per URL+JWT if a cache time was specified for that URL (cache-times.json)

Parameters:
Name Type Description
res *
To Do:
  • Cache also null/empty responses? (History APIs)

View Source api/api-cache.js, line 65