code: function buildCacheableResourcesFromParentObject(object){
    var resourcesToCache = [];
    var parentResource = {};
    if(utils.isCollectionData(object)){
      object.items.forEach(function(resource) {
        Array.prototype.push.apply(resourcesToCache, buildCacheableResourcesFromParentObject(resource));
      });
    }else{
      _.pairs(object).forEach(function(pair) {
        var prop = pair[0];
        var val = pair[1];
        if(val && val.href && _.keys(val).length>1){
          Array.prototype.push.apply(resourcesToCache, buildCacheableResourcesFromParentObject(val));
          parentResource[prop] = {
            href: val.href
          };
        }else{
          parentResource[prop] = val;
        }
      });
      if(parentResource.href){
        resourcesToCache.push(parentResource);
      }
  
      // This happens when a resource is a 302 direct from one to another,
      // cache the returned data under the requestedUrl as well
      if (object.requestData && object.requestData.originalHref !== object.href) {
        resourcesToCache.push(xtend(object,{href: object.requestData.originalHref}));
      }
    }
    return resourcesToCache;
  }
docs: /*
  Expect an object, which would be a JSON response from our API,
  which is searched for resources which can be cached. To be cached
  a resource must have an href and some other propeties.
  
  It returns an array of objects which can be passed on to the
  cache manager for caching in the appropriate regions