Fix github caching

We do caching of the requests to github using cachecontrol which is
injected into the urllib3 session. The caching needs to be entirely
etag based as max-age based caching leads to working with stale data.

Unlike documented [1] cachecontrol doesn't priorize the etag caching
but doesn't even rerequest until max-age was elapsed.

Thus we need to add a custom caching heuristic [2] which simply drops
the cache-control header containing max-age. This way we force
cachecontrol to only rely on the etag headers.

[1] http://cachecontrol.readthedocs.io/en/latest/etags.html
[2] http://cachecontrol.readthedocs.io/en/latest/custom_heuristics.html

Change-Id: If47e1eaa942914a243fc03666b83cd896665bd71
1 file changed