Caching critical resources for offline use