woob.browser.cache

class CacheMixin(*args, **kwargs)[source]

Bases: object

Mixin to inherit in a Browser

cache_is_updatable = True

Whether the cache is updatable

If False, once a request has been successfully executed, its response will always be returned.

If True, the ETag and Last-Modified of the response will be stored along with the cache. When the request is re-executed, instead of simply returning the previous response, the server is queried to check if a newer version of the page exists. If a newer page exists, it is returned instead and overwrites the obsolete page in the cache.

cache

Cache store object

To limit the size of the cache, a woob.tools.lrudict.LimitedLRUDict instance can be used.

make_cache_key(request)[source]

Make a key for the cache corresponding to the request.

open_with_cache(url, **kwargs)[source]

Perform a request using the cache if possible.