I've often thought a similar thing like this would work well for entertainment systems on flights too.
1,103 karma · joined October 10, 2011
I've often thought a similar thing like this would work well for entertainment systems on flights too.
I assume they will support Glacier soonish.
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.
Documentation: http://glue.readthedocs.org/en/latest/index.html
I originally created this handle working with an external API in a simple static files only app. It works really well for that usecase and solved my issues. It was then easy to make in a general way, so I decided to chuck it out in the wild and see if I can help anybody else.
Perhaps I should add an area to the README to define when you should (and maybe more importantly when you shouldn't) use this.
Pull requests, issues etc. all welcome. Otherwise, I'll have a look at it myself.