basket.js works only where HTML 5 localStorage is supported.
It saves JS scripts locally (without executing them) and optionally retrieves cached scripts when needed.
This does not refer to a session, but the scripts in general as a stand-alone entity. Meaning if a page is loaded and uses jQuery 1.7.2, the library will check localStorage for a previously cached version of it.
Implementing basket.js allows scripts to be cached between pages and immensely reduces page load times.
After getting a specific script from the local cache, basket.js can also execute custom callbacks after certain events.
Documentation is included with the download package.
What is new in this release:
- New additions to the Basket.js API include skipCache, which prevents storing scripts in cache.
What is new in version 0.4.0:
- Basket now supports custom handlers for resources other than JavaScript - e.g CSS, Text. See lower down for an example.
- Scripts begin loading immediately when you call thenRequire.
- Now supports a live option for caching the result, but always fetching live. It's for use by web apps that may be offline. In the example of a Twitter client, let's say that in the morning I go fetch your tweets while online. Later on I'm on the tube and go back to get your tweets. I can't get a live version, but I can get it from the cache and show a message letting the user know that the data is not fresh.
- Improved project unit tests.
What is new in version 0.3.1-pre.1:
- Improved project unit tests
- Supports RSVP 3.0.1, bumped dependencies for grunt tasks
- Now supports custom handlers for resources other than JavaScript - e.g CSS, Text
- Scripts begin loading immediately when you call thenRequire
Requirements:
- JavaScript enabled on client side
- HTML 5 enabled browser
Comments not found