Update Cache

I redid a good section of the cache script to make it more resilient to both network errors and errors that would be missed by the travis-ci powered JSON validation. There were also a few isolated instances of the script thinking that `type: ESRI` was `type: http`. All instance have been fixed.