pamelafox/lscache — pull request #30 by brophdawg11 (2014-06-07 03:09:12+00:00)
Title: Add public isExpired() method, and skipRemove/allowExpired get() parameters

I've added a little extra functionality for my own usage of lscache. I use lscache to cache AJAX responses to reduce calls from mobile apps. But, the problem I ran into was once the cache expired and I got a null response from get(), I launch another ajax request to refresh the data. However, if that call fails (no wifi connection, server error, etc.), there's no longer any cached/expired data available to use as a fallback. With the ability to call get() but skip the automatic removal, I can preserve the expired data as a fallback if needed. I have a jQuery plugin using the modified version of lscache here: https://github.com/brophdawg11/jquery.ajax.lscache