Skip to main content

Caching plugin for fastack

Project description

fastack-cache

fastack-cache is a caching plugin for fastack ❤️

This plugin is inspired by the django cache framework and django-redis!

Currently only supports redis as cache backend. And the plan in the future there will be aioredis and memcached as cache backends!

Installation

pip install fastack-cache

Usage

Add the plugin to your project configuration:

PLUGINS = [
    "fastack_cache",
    ...
]

Configuration:

REDIS_HOST = "localhost"
REDIS_PORT = 6900
REDIS_DB = 0
CACHES = {
    # cache name
    "default": {
        # cache backend
        "BACKEND": "fastack_cache.backends.redis.RedisBackend",
        # Cache options to be passed to the Redis(...) class
        "OPTIONS": {
            "host": REDIS_HOST,
            "port": REDIS_PORT,
            "db": REDIS_DB,
        },
        # Serializer for converting data into cache
        "SERIALIZER": {
            "CLASS": "fastack_cache.serializers.JSONSerializer",
            "OPTIONS": {
                # Option to pass when dumps() method in serializer class is called
                "DUMPS": {},
                # Option to pass when loads() method in serializer class is called
                "LOADS": {}
            }
        }
    }
}

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

fastack-cache-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

fastack_cache-1.0.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file fastack-cache-1.0.0.tar.gz.

File metadata

  • Download URL: fastack-cache-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.2 Linux/5.11.0-1022-azure

File hashes

Hashes for fastack-cache-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3a7447a9b85e458eb11d9578da0dddf6b933775dfda84f3ec3f867304b184262
MD5 3746d0518fc14925d03405ac058a6e04
BLAKE2b-256 d9ade914da7f4e18839078ed9d95db9b3968da564ff48ba6dcacc13166fa8e1a

See more details on using hashes here.

File details

Details for the file fastack_cache-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fastack_cache-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.2 Linux/5.11.0-1022-azure

File hashes

Hashes for fastack_cache-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daffffbef594f1f69561a6ecaadc3bcd8ac32aee6cbb4cd795fa1914c445c3af
MD5 2117ccf86d58c4085cc6b1ad69e911c5
BLAKE2b-256 4b23f49ff3020e497c1a9affe4fac10febfe9e39ea37a885e4cd966634e2be35

See more details on using hashes here.

Supported by

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