Skip to main content

Cache Scrapy responses with Redis.

Project description

scrapy-redis-httpcache

Cache Scrapy responses with Redis.

This package uses uv for project management. To get started, ensure that uv is installed on your machine and updated to the 0.5.6 version. Detailed installation instructions for uv can be found here.

Installation

uv add scrapy-redis-httpcache

Usage

Add the following settings to your Scrapy project settings file:

DOWNLOADER_MIDDLEWARES = {
    "scrapy.downloadermiddlewares.httpcache.HttpCacheMiddleware": 100,
    ...
}
HTTPCACHE_ENABLED = True
HTTPCACHE_EXPIRATION_SECS = ... # optional, defaults to 3600
HTTPCACHE_REDIS_DB = ... # optional, defaults to 0
HTTPCACHE_REDIS_HOST = ... # optional, defaults to "localhost"
HTTPCACHE_REDIS_PASSWORD = ... # optional, defaults to None
HTTPCACHE_REDIS_PORT = ... # optional, defaults to 6379
HTTPCACHE_REDIS_USERNAME = ... # optional, defaults to None
HTTPCACHE_STORAGE = "scrapy_redis_httpcache.RedisCacheStorage"

Development

uv sync --group=development
uv run pre-commit install --install-hooks
uv run pre-commit install --hook-type=commit-msg

Contributing

Contributions are welcome! To get started, please refer to our contribution guidelines.

Issues

If you encounter any problems while using this package, please open a new issue here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy_redis_httpcache-1.2.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapy_redis_httpcache-1.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_redis_httpcache-1.2.0.tar.gz.

File metadata

File hashes

Hashes for scrapy_redis_httpcache-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f6a21720e647ec0da180de84473ba399a6d17ab889135eeee8d8b12bcde4cfbb
MD5 5d3d81c863366ca5ff603614e9f98677
BLAKE2b-256 0c9935ef56466e0d634db98f964b926e32c71cf7fe954129928694ea89341e5b

See more details on using hashes here.

File details

Details for the file scrapy_redis_httpcache-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_redis_httpcache-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 247ae8058a5643e07e91393626e7fe3d1fb0a2ad15908c7ba14acc4b7dad149c
MD5 d942d6277c49899b07d71f2c454f75fd
BLAKE2b-256 0b25a55366daa56f1b83a01e8593f8378afabd9ec8e08a8b79e0f77fe661337f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page