3 ms·
Hi, Author of locache.js (http://locachejs.org/ http://locachejs.org/) here. I think there is a good use case for something like this in certain situations, bu
by d0ugal 14y ago
Hi, Author of locache.js (http://locachejs.org/ http://locachejs.org/) here.
I think there is a good use case for something like this in certain situations, but using the browser cache for Ajax requests is generally a better idea.
I wrote locache as a more general client-side cache mechanism for all sorts of objects rather than just caching requests. I was caching lots of backbone models and user actions - it generally worked quite well. I also actually used it quite a bit for caching third party API's that I had no control over (more specifically I was working on a mashup using three different API's and often fetching the same content). When being lazy I tried once to cache my own API and regretted it after as its basically a poor mans browser cache.
Your going to run into a bunch of issues with localStorage if you have not already - specifically to do with memory limits, the blocking API and some strange support on mobile browsers. You may find some useful things in my code, or you may want to drop me a line to discuss it further.