mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
9ac649444d
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.
12 lines
405 B
Python
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
|