Update cache.js

Added support for max app resume tries