scrachy.middleware.httpcache.BlacklistPolicy

class scrachy.middleware.httpcache.BlacklistPolicy(settings: Settings)[source]

Bases: object

A wrapper around another cache control policy, but you can also blacklist urls (exclude from caching) via pattern matching using the SCRACHY_POLICY_EXCLUDE_URL_PATTERNS setting. The patterns must either be strings that can be compiled with re.compile() or re.Pattern objects.

__init__(settings: Settings)[source]

Methods

__init__(settings)

is_excluded(url)

should_cache_request(request)

should_cache_response(response, request)