In-Browser Cache leverages modern browser capabilities through the Service Worker API to implement in-browser caching for static assets, improving website performance while providing transparent metrics.
Unlike traditional server-side caching plugins, In-Browser Cache operates entirely on the client-side, reducing network requests and improving page load times on repeat visits.
In-Browser Cache uses the Service Worker API to intercept network requests and apply different caching strategies:
This plugin ships with complete source code for transparency and developer customization:
/src/ directory
src/admin.js – Settings page functionalitysrc/dashboard.js – Metrics dashboard with Chart.js integrationsrc/service-worker.js – Main Service Worker with Workbox integrationIf you need to modify the JavaScript source code, you can rebuild the assets:
Prerequisites:
* Node.js 20.x or higher
* npm
Build Commands:
Install dependencies
npm install
Clean and build all assets
npm run build
Build individual components
npm run build:admin # Settings page
npm run build:dashboard # Metrics dashboard
npm run build:sw # Service worker
Clean build directory
npm run clean
Built files are output to the /build/ directory and automatically used by the plugin.