A cache library for WeChat Mini Programs (微信小程序) that wraps network requests with deduplication and caching. Version 5.3.0-alpha.0, pre-release with active development. Provides CacheOperator to merge concurrent identical requests and cache responses based on configurable key builder and expiry. Differentiator: specifically designed for WeChat Mini Program API (wx.request) with zero-config defaults for common use cases, unlike generic browser caches.
npm install miniprogram-network-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cached wx.request handler that caches responses for 60 seconds and deduplicates identical requests.
Pin to exact version and test thoroughly before upgrading.
Provide a custom keyBuilder that generates a short unique string (e.g., op.url + JSON.stringify(op.data)).
Implement persistent storage (e.g., wx.setStorage) separately if needed.
Run 'npm install miniprogram-network-cache@5.3.0-alpha.0' and ensure package.json includes it.
Use 'CacheOperator.createHandler(...)' or 'const operator = new CacheOperator(...)' then call operator.createHandler() – but recommended to use createHandler directly.
No dependency data recorded yet.