1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00
SickRage/lib/cachecontrol/wrapper.py
echel0n 9ac649444d Added cache_auto, cache_urls, and cache_max_age features to our cache handler.
Added session handler to our cache handler so that we can pass in paramaters at the request level and use them for our cache handler to process features.
2014-03-28 21:23:55 -07:00

12 lines
405 B
Python

from cachecontrol.session import CacheControlSession
from cachecontrol.adapter import CacheControlAdapter
from cachecontrol.cache import DictCache
def CacheControl(sess=None, cache=None, cache_etags=True):
sess = sess or CacheControlSession()
cache = cache or DictCache()
adapter = CacheControlAdapter(sess, cache, cache_etags=cache_etags)
sess.mount('http://', adapter)
return sess