diff --git a/packages/ajax/README.md b/packages/ajax/README.md index 40705a2cd..d69d7c693 100644 --- a/packages/ajax/README.md +++ b/packages/ajax/README.md @@ -225,9 +225,9 @@ Alternatively, most often for subclassers, you can extend or import `AjaxClient` ```js import { AjaxClient } from '@lion/ajax'; -export const ajax = new AjaxClient({ - cacheOptions: { - useCache: true, +export const ajax = new AjaxClient({ + cacheOptions: { + useCache: true, timeToLive: 1000 * 60 * 5, // 5 minutes getCacheIdentifier: () => getActiveProfile().profileId, }, @@ -319,8 +319,8 @@ After TTL expires, the next request will set the cache again, and for the next 3 export const cacheTimeToLive = () => { const actionLogger = renderLitAsNode(html``); const fetchHandler = () => { - ajax.requestJson(`./packages/ajax/docs/pabu.json`, { - cacheOptions: { + ajax.requestJson(`./packages/ajax/docs/pabu.json`, { + cacheOptions: { timeToLive: 1000 * 3, // 3 seconds } }) @@ -441,7 +441,7 @@ export const invalidateRules = () => { actionCacheOptions.invalidateUrlsRegex = /\/packages\/ajax\/docs\/naga.json/; } - ajax.requestJson(`./packages/ajax/docs/${name}.json`, { + ajax.requestJson(`./packages/ajax/docs/${name}.json`, { method, cacheOptions: actionCacheOptions, }) @@ -463,4 +463,4 @@ export const invalidateRules = () => { ${actionLogger} `; } -``` \ No newline at end of file +``` diff --git a/packages/ajax/src/interceptors-cache.js b/packages/ajax/src/interceptors-cache.js index 5c861b318..bf44bb32a 100644 --- a/packages/ajax/src/interceptors-cache.js +++ b/packages/ajax/src/interceptors-cache.js @@ -253,7 +253,6 @@ export const cacheRequestInterceptorFactory = (getCacheIdentifier, globalCacheOp if (cacheOptions.invalidateUrls) { cacheOptions.invalidateUrls.forEach( /** @type {string} */ invalidateUrl => { - console.log('invalidaaaating', currentCache._cacheObject); currentCache.delete(invalidateUrl); }, );