I am currently writing a project and looking to implement the JavaScript Cache interface in order to prevent redundant API calls. My concern here is that by caching the API calls (which contain the users API credentials), it will potentially leave my application open to a form of XSS attack where they reference as many browser caches as they can within their own "attacker" site with say a link in a phishing email.
Is JavaScript browser caching safe enough to do that without worrying, or are there 'cache scrubbing' type attacks which make it inadvisable? Also, if it is unsafe by default, is there a way to make it safe? If it is or can be made safe it will save me tons of work but don't want to utilize unsafe methods of storing "sensitive" user information (the only sensitive thing it gives away are API credentials which can be used to perform CRUD operations against the service the API is hosted from, which themselves could contain actually sensitive information).