Acts just like the $xhr
service but caches responses for GET
requests. All cache misses are delegated to the $xhr service.
cache(method, url[, post], success, error[, verifyCache][, sync]);
method – {string} –
HTTP method.
url – {string} –
Destination URL.
post(optional) – {(string|Object)} –
Request body.
success – {function(number, (string|Object), Function)} –
Response success callback.
error – {function(number, (string|Object), Function)} –
Response error callback.
verifyCache(optional=false) – {boolean} –
If true
then a result is immediately returned from cache
(if present) while a request is sent to the server for a fresh response that will update the
cached entry. The success
function will be called when the response is received.
sync(optional=false) – {boolean} –
in case of cache hit execute success
synchronously.
Function to delegate all the cache misses to. Defaults to
the $xhr
service.
The hashmap where all cached entries are stored.