{ "info": { "author": "Rafis Gubajdullin", "author_email": "raf.gbd@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "django-clever-cache\n===================\n\nDjango cache backend with automatic granular invalidation.\n\nRequires\n--------\n\n- django >= 1.8\n- redis >= 3.0\n- django-redis\n\nInstallation and setup\n----------------------\n\n.. code:: sh\n\n $ pip install django-clever-cache\n\nin settings.py: add ``clever_cache`` to INSTALLED\\_APPS, and set\n``clever_cache.backend.RedisCache`` as your cache backend.\n\n.. code:: python\n\n CACHES = {\n \"default\": {\n \"BACKEND\": 'clever_cache.backend.RedisCache',\n \"LOCATION\": \"redis://127.0.0.1:6379/1\",\n \"OPTIONS\": {\n 'DB': 1,\n }\n }\n }\n\nUsage\n-----\n\nto save value in cache use standart function\n``django.core.cache.cache.set`` with optional argument ``depends_on``:\n``cache.set(key, value, depends_on=[])``\n\nDependency can be:\n\nModel class\n~~~~~~~~~~~\nif you set model class as dependency (``cache.set(key, value, depends_on=[SomeModel])``), and change any\ninstance of SomeModel, call ``bulk_create``, ``update`` or ``delete`` to\nmodel's queryset, key will be invalidated.\n\nModel instance\n~~~~~~~~~~~~~~\n\nif you set model instance as dependency\n(``cache.set(key, value, depends_on=[some_instance])``), and change this\ninstance(including changing m2m fields), key will be invalidated.\n\nRelated manger\n~~~~~~~~~~~~~~\n\nLet's assume you have following models:\n\n.. code:: python\n\n class Parent(models.Model):\n name = models.CharField(max_length=32)\n\n class Child(models.Model):\n parent = models.ForeignKey(Parent)\n name = models.CharField(max_length=32)\n\n some_parent = Parent.objects.get(id=42)\n\nso, if you set related manager as a dependency\n(``cache.set(key, value, depends_on=[some_parent.child_set])``), and\nchange any Child object with parent = some\\_parent, key will be\ninvalidated.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RafGb/django-clever-cache", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-clever-cache", "package_url": "https://pypi.org/project/django-clever-cache/", "platform": "", "project_url": "https://pypi.org/project/django-clever-cache/", "project_urls": { "Homepage": "https://github.com/RafGb/django-clever-cache" }, "release_url": "https://pypi.org/project/django-clever-cache/0.0.1/", "requires_dist": [ "django (>=1.8)", "django-redis" ], "requires_python": "", "summary": "Django cache backend with automatic granular invalidation", "version": "0.0.1" }, "last_serial": 3165714, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a1a8430fc15b6cc746e5156395182a64", "sha256": "10ed06759833ac2a188f8d6325fb3f6a2a7b311326f3a6b9e282d344c721ccdf" }, "downloads": -1, "filename": "django_clever_cache-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a1a8430fc15b6cc746e5156395182a64", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11543, "upload_time": "2017-09-11T16:13:06", "url": "https://files.pythonhosted.org/packages/bf/8c/7fc0bc0626b55738dcdbe98a9cf193afbff951527df871540bf67e6b916a/django_clever_cache-0.0.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a1a8430fc15b6cc746e5156395182a64", "sha256": "10ed06759833ac2a188f8d6325fb3f6a2a7b311326f3a6b9e282d344c721ccdf" }, "downloads": -1, "filename": "django_clever_cache-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a1a8430fc15b6cc746e5156395182a64", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11543, "upload_time": "2017-09-11T16:13:06", "url": "https://files.pythonhosted.org/packages/bf/8c/7fc0bc0626b55738dcdbe98a9cf193afbff951527df871540bf67e6b916a/django_clever_cache-0.0.1-py2.py3-none-any.whl" } ] }