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

Bloodhound: Results returned when LS cache is empty. #694

Closed
richardkmichael opened this issue Feb 15, 2014 · 4 comments
Closed

Bloodhound: Results returned when LS cache is empty. #694

richardkmichael opened this issue Feb 15, 2014 · 4 comments
Milestone

Comments

@richardkmichael
Copy link

Instead of lowering the ttl of a BH prefetch, I wanted to try allowing the user to empty the cache. At first, I naively tried clearing localStorage out from under BH, then also tried keeping a reference to the BH engine and using the PersistentStorage public API to clear it:

  • <button onclick='localStorage.clear();'>
  • <button onclick='engine.storage.clear();'>

Neither "work"; after clearing the storage, TA still displays suggestions.

I've looked through the code only a bit so far, and I'm guessing this is happening from memory (probably not flushed, although the cache itself is).

I hoped TA would cache miss, and fire another "prefetch" request. Failing a fired prefetch, I would expect 0 suggestions (empty cache, therefore no matches). I'm wondering if displaying suggestions when the cache is empty is a "bug"; or, more likely, a misunderstanding on my part? :-)

@jharding
Copy link
Contributor

Hmm so it sounds like you're looking for the ability to refetch prefetch data on-demand? Is that correct?

@richardkmichael
Copy link
Author

Yes, that's right.

On Mon, Feb 17, 2014 at 5:52 PM, Jake Harding [email protected]:

Hmm so it sounds like you're looking for the ability to refetch prefetch
data on-demand? Is that correct?


Reply to this email directly or view it on GitHubhttps://github.com//issues/694#issuecomment-35330557
.

@jharding
Copy link
Contributor

Alright, cool. I've seen a handful of requests for that sort of ability so I'm thinking I may prioritize it for the next release.

@richardkmichael
Copy link
Author

Wow, great, thanks!

Regarding "on-demand"; I could see this going a few ways:

  • empty the cache, which would induce a fetch [when because of the cache miss]; or,
  • an API method to do a fetch (I actually didn't think of this; maybe that's possible now?)

I'll wait to see your implementation.

On Mon, Feb 17, 2014 at 6:09 PM, Jake Harding [email protected]:

Alright, cool. I've seen a handful of requests for that sort of ability so
I'm thinking I may prioritize it for the next release.


Reply to this email directly or view it on GitHubhttps://github.com//issues/694#issuecomment-35331686
.

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

2 participants