JAVASCRIPT CLIENT SIDE CACHING.



locache

Having a memcache motivated API use is quite easy. Locache doesn't have dependencies and is tiny.

Locache gracefully degrades if the browser does not support localStorage. Normally that is IE6 or IE7, you will not get any mistakes, but caching efforts will be quietly dropped and lookups would always seem to be a cache miss.

Locache.js is not a replacement for cache headers, and also will not replace actual server side caching. But, locache may be used to speed up pages By caching effects from APIs you can not restrain or by caching complicated structures made in JavaScript to prevent recreating. This works nicely with Models in back or left templates such as.

Placing, removing and getting worth
If you store an item, that is what you will receive back. By Way of Example, a variety:

Storing complex objects is not a issue too. Just be certain that they're JSON serializable.

You could even perform batch operations.

Placing values which perish

Since localStorage does not support dying worth, but they will nevertheless be left . This might or might not be troublesome for you. If you would like to be certain that they're cleaned up, use the next procedure on page loading, or using a setTimeout loop.