A Django app for the caching api data while get method and removing after data altered or created.
Project description
django-cache-middleware
django-cache-middleware is a Django app for the caching api data while get method and removing after data altered or created.
Installation
* pip install django-cache-middleware
* Add ``cache_middleware`` to your ``INSTALLED_APPS``
* Add ``cache_middleware.middlewares.CacheMiddleware`` to your ``MIDDLEWARE``
* set django redis for your project (https://pypi.org/project/django-redis/)
::
Setup in settings
* REMOVE_RELATED_CACHE : bool # default True # remove related model data i.e o2m, m2o, m2m, 020 dat
* CACHE_REMOVE_TIMEOUT : integer | None # default None # cache removing time
* BASE_API_URL : str # default /api/ # base api url
* CACHE_NAME : str # default settings.ROOT_URLCONF.split('.')[0] # name of cache base key name
::
Compatibility
{py37, py38, py310}-django{4.* above}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file cache_middleware_django-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: cache_middleware_django-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4511af115127781bc98b93705d245240d74c2d4d4645b5da7f16909212711ed1 |
|
MD5 | cc37bcd55c6a4f390c45e6bd574ead9a |
|
BLAKE2b-256 | 5c98e6f0aad99aa96fd5b675ca0dd3d56639a80ce040df1e95df4a2942ae447d |