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], callback[, verifyCache]);
method – {string} –
HTTP method.
url – {string} –
Destination URL.
post(optional) – {(string|Object)} –
Request body.
callback – {function(number, (string|Object))} –
Response 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 callback
function will be called when the response is received.
Function to delegate all the cache misses to. Defaults to
the $xhr
service.
The hashmap where all cached entries are stored.