Skip to main content

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


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

cache_middleware_django-0.0.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

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