### Install fetchCache using Bower Source: https://github.com/sanemethod/fetchcache/blob/master/README.md Use Bower to install fetchCache. This command should be run in your project's terminal. ```bash bower install fetchCache ``` -------------------------------- ### JSON Fetch Example with fetchCache Source: https://github.com/sanemethod/fetchcache/blob/master/README.md Shows a JSON fetch request using fetchCache with specific parameters. The response can be directly from the server or from the cache. ```javascript fetch('url', { method: 'GET', credentials: 'include', localCache: true, cacheKey: 'cachedJSON' }).then((res) => { return res.json(); }).then((json) => { // Your json parsed response is available here, either direct from the server, // or pulled from the cache if a cached value for the specified cacheKey is available. }); ``` -------------------------------- ### Fetch Request with fetchCache Parameters Source: https://github.com/sanemethod/fetchcache/blob/master/README.md Demonstrates how to use fetchCache parameters in a Fetch API request. Ensure this script runs before any other code that calls fetch. ```javascript fetch('url', { method: 'GET', localCache : true, // Required. Either a boolean, in which case localStorage will be used, or // an object that implements the Storage interface. cacheTTL : 1, // Optional. In hours, default is 5. cacheKey : 'post', // Optional. If not included, a cacheKey will be generated from the URL, the // content-type header and the request body, if available. isCacheValid : function(){ return true; } }).then(function(response){ // The response is available here. }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.