A script and resource loader that caches files in localStorage to improve page load performance.
Basket.js is a JavaScript library that loads and caches scripts and resources in the browser's localStorage. It solves the problem of slow page loads by storing frequently used files locally, reducing network requests and improving performance on subsequent visits.
Frontend developers and web performance engineers who need to optimize script loading and reduce page load times in web applications.
Developers choose Basket.js for its simple, promise-based API and fine-grained control over caching behavior, including versioning and expiration, making it a lightweight alternative to more complex asset loading solutions.
A script and resource loader for caching & loading files with localStorage
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically caches loaded scripts in localStorage, reducing network requests and improving page load times on repeat visits, as core to its design.
Offers customizable expiration times, versioning via the 'unique' option, and custom storage keys, allowing precise cache management per the API.
Provides a clean, promise-based interface for asynchronous script loading, making it easy to integrate with modern JavaScript workflows, as highlighted in features.
Supports adding handlers for different content types like CSS or HTML via addHandler, enabling caching beyond just JavaScript files.
Relies on browser localStorage with strict size caps (usually 5-10 MB), making it unsuitable for large libraries or numerous assets without manual cleanup.
Requires browsers to support localStorage and Promises; older browsers need polyfills, adding setup complexity and potential performance overhead.
Lacks automatic fallback mechanisms if cache fails or is corrupt, forcing developers to implement error handling manually for robustness.