mixu / minilog

Lightweight client & server-side logging with Stream-API backends
http://mixu.net/minilog/
Other
380 stars 51 forks source link

Getting localStorage to act as a cache for ajax requests #21

Closed itaykomemy closed 9 years ago

itaykomemy commented 10 years ago

I have tried to get it to work but with no avail. From looking at the code it seems like it is not supported.

From the website: "Unsent logs from localStorage are sent the next time the backend is activated (on your domain, localStorage is isolated)." So it seems like it should be implemented already. Could you explain how to set that up?

Many Thanks, Itay.

mixu commented 10 years ago

Sorry, I think that feature was deprecated some time ago. The problem we ran into with localStorage was that it could become slow if something else was also writing to localStorage since storing into it can be quite slow. This was a couple of years ago so things may have changed on that front.

The code that deals with caching to localStorage is still around, it probably needs to be updated to the new API though:

https://github.com/mixu/minilog/blob/346431c4ed85df2ec6c41a586765cb449039e04d/lib/browser/cache.js

https://github.com/mixu/minilog/blob/346431c4ed85df2ec6c41a586765cb449039e04d/lib/browser/jquery.js