localStorage not refreshed with prefetch
Hi, localStorage doesn't seem to be refreshed when json changed, when using prefetch. Thanks !
The default TTL is three days. Did you want something shorter? (use the ttl_ms option when defining a dataset to set the prefetch TTL in milliseconds) Or did it do a second request and fail to write that to localStorage?
Note that the ttl_ms option isn't documented and may change in the future. We need to make it more explicit in the README that prefetched data is stored in localStorage. Also might want to make it configurable whether or not we even use localStorage. I guess you could just set ttl_ms to 0.
Well, it would be good, so I tried ttl_ms like that :
$('input[name="regionField"]').typeahead({
name: 'regions',
ttl_ms: 0,
prefetch: '/getregions.json?country=FR',
remote: '/getregions.json?country=FR&query=%QUERY'
});
But prefetch'ed items are always the same. I don't see any error in Firebug, and there don't seem to be any new call to the prefetch URL...
Hmm might be a bug. For now you can clear localStorage by running window.localStorage.clear(). I'll make sure we have a resolution for this issue in v0.8.1.
Well, localStorage get cleaned. Now, I'm back to the bug I first reported on twitter : I created issue 27 Thanks
I believe #34 will resolve this issue.
Great !