tweet icon indicating copy to clipboard operation
tweet copied to clipboard

Adding Simple HTML5 Caching (every minute)

Open briankerrdesign opened this issue 11 years ago • 4 comments

For those running into Rate Limiting - https://dev.twitter.com/docs/rate-limiting

Kinda tested....

briankerrdesign avatar Nov 08 '12 20:11 briankerrdesign

Interesting. If I'm understanding your intention and code correctly, it looks like this would not support multiple widgets on one page, which isn't ideal... The cache key should probably be related to the API request URL.

purcell avatar Nov 08 '12 20:11 purcell

Yes, I stored the data under a single key in the local array. You could make that ket specific to each the widget with an ID or hash.]

** Brian Kerr Designer & Developer

[email protected] www.briankerrdesign.com

On Thu, Nov 8, 2012 at 12:53 PM, Steve Purcell [email protected]:

Interesting. If I'm understanding your intention and code correctly, it looks like this would not support multiple widgets on one page, which isn't ideal... The cache key should probably be related to the API request URL.

— Reply to this email directly or view it on GitHubhttps://github.com/seaofclouds/tweet/pull/303#issuecomment-10204456.

briankerrdesign avatar Nov 08 '12 20:11 briankerrdesign

Cool. I'll have a play with this code when I get some time. Thanks for sending it over! :-)

purcell avatar Nov 08 '12 20:11 purcell

Hm, I took a look at this and it sort of looks like there's an infinite chain of caching. load() caches it into tweetData, and then passes the cached information into extractData, which passes the same information back into tweetData if it's an odd minute. Am I missing something, though?

mattstauffer avatar Mar 04 '13 23:03 mattstauffer