Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localStorage not refreshed with prefetch #19

Closed
calexo opened this issue Feb 21, 2013 · 7 comments
Closed

localStorage not refreshed with prefetch #19

calexo opened this issue Feb 21, 2013 · 7 comments
Milestone

Comments

@calexo
Copy link
Contributor

calexo commented Feb 21, 2013

Hi,
localStorage doesn't seem to be refreshed when json changed, when using prefetch.
Thanks !

@timtrueman
Copy link
Contributor

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?

@jharding
Copy link
Contributor

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.

@calexo
Copy link
Contributor Author

calexo commented Feb 22, 2013

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...

@jharding
Copy link
Contributor

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.

@calexo
Copy link
Contributor Author

calexo commented Feb 22, 2013

Well, localStorage get cleaned.
Now, I'm back to the bug I first reported on twitter : I created issue 27
Thanks

@jharding
Copy link
Contributor

I believe #34 will resolve this issue.

@calexo
Copy link
Contributor Author

calexo commented Feb 23, 2013

Great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants