davidbauer / Instacurate

Turn your Twitter timeline into a personalised news site, in an instant. Fetches links from your timeline and displays them in a discovery friendly design.
http://www.instacurate.com
113 stars 29 forks source link

content gets mixed up if input switched before all content is loaded #104

Open davidbauer opened 10 years ago

davidbauer commented 10 years ago

click the suggestions "news", "politics", "science" quickly after another without waiting for the whole content of each to be loaded.

expected result: only links from the subreddit selected last shows up actual result: links from all three subreddits show up mixed together

davidbauer commented 10 years ago

how can I abort all running processes once a new input is given?

davidbauer commented 9 years ago

@jackhughesweb, maybe you know how to fix this, too?

jackhughesweb commented 9 years ago

I'm not sure on how to abort the loading of the subreddit, but I noticed that the web app sends a request to embed-cache.php for every link. This would be fine for a few links, but for 25 links, this creates a delay of ~10s. Maybe it would be better to send the all of the links in a single request, as this would greatly speed up the page?

davidbauer commented 9 years ago

sounds reasonable, though I have no experience with such things whatsoever. @oliverwehn wrote the code for the cache, maybe he can help?

jackhughesweb commented 9 years ago

Not sure on how exactly it would work, but maybe something like sending an array of links to embed-cache.php and then looping through each array item using the current code, saving the output to a new array and then returning this in JSON? @oliverwehn

oliverwehn commented 9 years ago

I’ll look right into it.