Closed jimallman closed 5 years ago
FYI - This is now deployed on devapi. In my testing, it correctly ignores the early broken response after deployment, then shows proper behavior a couple of minutes later. (Sadly, the error page does not reload to our default view, so you need to browse back to the homepage to see the happy tree.)
looks great. thanks, @jimallman !
In order to avoid poisoning our cache with failed API calls, we should preserve any failed response code during API calls, and raise appropriate (web2py-class) exceptions. This will pass the error directly back to the client (and troubleshooters), and ensure that the bad response is ignored by web2py's RAM cache.
N.B. By default, webp2y's RAM cache will ignore any response with status codes other than 1xx, 2xx, 3xx. We can narrow that further to only cache 200 responses, but I believe urllib2 will successfully follow some of the other response types (e.g. redirects) and fill the cache properly.