Many people are experiencing issue with rate limit - see issues 1073116, 1209310, etc.
Attached patch improves caching mechanism to deal with this issues. It introduce following three improvements:
1) minimum cache time: before this period expiries no request to twitter server will be done and cache will be reused. Set to 20 minutes
2) maximum cache time: before this period expiries, cached data will be reused in case API calls fails due to error. Set to 12 hours.
3) cache speed up: amount of time, by which minimum cache time should be decreased every 20 minutes(minimum cache time). Set to 1 minute.
In case API will be unavailable for longer time you can expect following delays: 19, 18, 17, 16, .... 1, 1, 1, 1, 0, 0, 0
This patched showed significant improvement on busy shared web-hosting and can be seen in action at http://www.radekdostal.com
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | twitter_pull-7.x-2.x-1820002-2.patch | 4.44 KB | aasarava |
| #1 | 1820002-reroll.patch | 4.32 KB | geoffreyr |
| 0001-Making-caching-mechanism-more-configurable-to-deal-w.patch | 4.16 KB | radekdostal |
Comments
Comment #0.0
radekdostal commentedAdding domain where patch can be seen in action
Comment #1
geoffreyr commentedTried to reroll this one against 7.x-1.x if anyone wants it.
Comment #2
aasarava commentedRerolled for 7.x-2.x-dev (as of Jun 13 2013).
Comment #3
mthomas commentedThis is great, thanks!
Comment #3.0
mthomas commentedBetter explanation of speed up
Comment #4
BarisW commentedThanks. Works great. Please commit.
Updated the version, as this patch applies against the 7.x-2.x branch.
Comment #5
joachim commentedThis looks like an interesting approach, but I'm not quite sure I follow all of it!
Any chance of a more detailed explanation in the summary?
After that, the patch will need a fair bit of cleanup -- mostly formatting, but also a hook_update_N() to convert the variable it's removing.
This looks like an unrelated change.
Comment #6
jennypanighetti commentedCan this patch be committed please? Thanks.