invalid_func: A function that takes API response, and returns TRUE or FALSE whether caching takes place. Default cache everything.
Returns
TRUE if successful.
Examples
## Not run:# demo function to cache withinshorten_url_cache <-function(url){ body = list(longUrl = url) f <- gar_api_generator("https://www.googleapis.com/urlshortener/v1/url","POST", data_parse_function =function(x) x) f(the_body = body)}## only cache if this URL gar_cache_setup(invalid_func =function(req){ req$content$longUrl =="http://code.markedmondson.me/"})# authentication gar_auth()## caches shorten_url_cache("http://code.markedmondson.me")## read cache shorten_url("http://code.markedmondson.me")## ..but dont cache me shorten_url_cache("http://blahblah.com")## End(Not run)