scrachy.middleware.httpcache.BlacklistPolicy
- class scrachy.middleware.httpcache.BlacklistPolicy(settings: Settings)[source]
Bases:
objectA wrapper around another cache control policy, but you can also blacklist urls (exclude from caching) via pattern matching using the
SCRACHY_POLICY_EXCLUDE_URL_PATTERNSsetting. The patterns must either be strings that can be compiled withre.compile()orre.Patternobjects.Methods
__init__(settings)is_excluded(url)should_cache_request(request)should_cache_response(response, request)