vizshine / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

[PATCH] Do not cache responses that resulted in an error #168

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 

imho it makes little sense to cache the regularly occurring error responses 
from the twitter API servers. A 502 Bad Gateway status would mean, for example, 
that the same (usually transient) error is returned until the cache-timeout 
expires. 

Therefore, the attached patch only caches successful requests. 

Alternatively one could also cache responses with status codes in the 400 since 
those usually are not as transient as the 500s. (E.g., a 404 Not Found status 
will only rarely disappear as a result to a repeated identical request).

thx
-d

Original issue reported on code.google.com by yae...@gmail.com on 30 Sep 2010 at 10:02

Attachments:

GoogleCodeExporter commented 8 years ago
The patch had bit-rotted, but seeing how simple it was I applied it manually :)

thanks!

committed as part of revision 0c2b7518c4

Original comment by bear42 on 16 Oct 2010 at 7:32