Caching
π Caching the Response
// Cache for 5 seconds
await httpGet('Main', '/endpoint', { cache: 5000 });
// Permanent cache
await httpGet('Main', '/endpoint', { cache: true });π§Ή Deleting the Cache
const hooks: ShapeRQHooks = {
onRequest: ({ url, cacheDel }) => {
cacheDel(url); // Delete cache for this URL before the request
},
};
await httpGet('Main', '/endpoint', { hooks });π¦ Retrieving from Cache
Last updated