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 --frozen --group=development
uv run --frozen pre-commit install --install-hooks
uv run --frozen 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.4.0.tar.gz (30.4 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.4.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for scrapy_redis_httpcache-1.4.0.tar.gz
Algorithm Hash digest
SHA256 aa15f9afbfd323ebbc29e8697be3a33fd31ded0388ce5a06b1ef82fac69f96e6
MD5 ae59a395c9cfb9e1cd7a07d804c28c97
BLAKE2b-256 9c05778d7c794b7b9e5069a3da1fae62058577ea559c18f2c7589800a6cd99be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scrapy_redis_httpcache-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d05df5d5bef72c4d8952bae8b9757436171b92c9adbbc637ef3c5cb69cfe225
MD5 38ffca10b5ea7ca8aeea4931b24d45bd
BLAKE2b-256 2134c0524af5c747d975acb965e16b4c83198fd64a3bae6ad51570506c7f5e50

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