Module

cache-service

Methods

# inner createCache(storage, options)

Cache wrapper on top of localforage (Used for API calls caching)

Parameters:
Name Type Description
storage *
options *

View Source services/cache-service.js, line 72

# inner get(url)

Retrieve data from cache if key has an expiration time and cache is enabled and cached data is not expired

Parameters:
Name Type Description
url *

View Source services/cache-service.js, line 134

# inner getCacheTime(times, key)

Get cache time value from object Supports retrieving value by matching a key who contains a wildcard

Parameters:
Name Type Description
times *
key *

View Source services/cache-service.js, line 192

Example
{
     "/v2/temps_reel/by_vehicule**":"1000"
   }
   getCacheTime(times, "/v2/temps_reel/by_vehicule?vehicule_id=3125")

   //Will return 1000

# inner getCacheTimes()

Retrieves cache times per key (normalized)

View Source services/cache-service.js, line 114

# inner set(key, value)

Store data if the key has an expiration time and cache is enabled

Parameters:
Name Type Description
key *
value *

View Source services/cache-service.js, line 251

# inner shouldCache(key)

Check if a key has an expiration time and if cache is enabled

Parameters:
Name Type Description
key *

View Source services/cache-service.js, line 235

# inner shouldDisableCache()

Checks if cache should be disabled via an special URL parameter

View Source services/cache-service.js, line 107