{"id":21068378,"url":"https://github.com/renskiy/django-cache","last_synced_at":"2025-05-16T03:33:12.674Z","repository":{"id":57419181,"uuid":"63470433","full_name":"renskiy/django-cache","owner":"renskiy","description":"Enhanced cache_page decorator for Django views","archived":false,"fork":false,"pushed_at":"2017-10-19T06:17:33.000Z","size":23,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-05T14:16:17.866Z","etag":null,"topics":["cache","django","http-cache"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renskiy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-16T07:07:27.000Z","updated_at":"2024-01-17T18:08:05.000Z","dependencies_parsed_at":"2022-09-07T07:40:48.897Z","dependency_job_id":null,"html_url":"https://github.com/renskiy/django-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renskiy%2Fdjango-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renskiy%2Fdjango-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renskiy%2Fdjango-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renskiy%2Fdjango-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renskiy","download_url":"https://codeload.github.com/renskiy/django-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225199446,"owners_count":17437038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","django","http-cache"],"created_at":"2024-11-19T18:20:19.144Z","updated_at":"2024-11-19T18:20:19.860Z","avatar_url":"https://github.com/renskiy.png","language":"Python","readme":"============\nDjango-cache\n============\n\nEnhanced :code:`cache_page` decorator for `Django`_ views.\n\n.. _Django: https://www.djangoproject.com\n\n.. image:: https://travis-ci.org/renskiy/django-cache.svg?branch=master\n    :target: https://travis-ci.org/renskiy/django-cache\n.. image:: https://coveralls.io/repos/github/renskiy/django-cache/badge.svg?branch=master\n    :target: https://coveralls.io/github/renskiy/django-cache?branch=master\n\nCompatibility\n-------------\n\nDjango-cache properly works with Django 1.8, 1.9, 1.10 and 1.11 on Python 2.7, 3.4, 3.5 and 3.6.\n\nAdvantages\n----------\n\n* fixed certain amount of bugs (including `#15855`_)\n* support of callable :code:`cache_timeout` and :code:`key_prefix` parameters\n* cache age can be limited by client (min cache age is manageable, default is 0)\n\n.. _#15855: https://code.djangoproject.com/ticket/15855\n\nUsage\n-----\n\n.. code-block:: python\n\n    from djangocache import cache_page\n\n    @cache_page(cache_timeout=600)\n    def view(request):\n        pass\n\nCombination with :code:`last_modified` and/or :code:`etag` view decorators\n--------------------------------------------------------------------------\n\nIf you planning to use :code:`cache_page` among with :code:`last_modified` and/or :code:`etag` the latter must be placed after :code:`cache_page`:\n\n.. code-block:: python\n\n    from djangocache import cache_page\n    from django.views.decorators.http import last_modified, etag\n\n    def etag_generator(request, *args, **kwargs):\n        return 'ETag!!'\n\n    @cache_page(cache_timeout=600)\n    @etag(etag_generator)\n    def view(request, *args, **kwargs):\n        pass\n\nDjango Settings\n---------------\n\n``DJANGOCACHE_MIN_AGE`` - used to set minimal age of cache. Default is 0, meaning that client can ask server to skip cache by providing header ``Cache-Control: max-age=0``.\n\n``@cache_page`` params\n----------------------\n\n* ``cache_timeout``. Default is ``settings.CACHE_MIDDLEWARE_SECONDS``.\n* ``key_prefix``. Default is ``settings.CACHE_MIDDLEWARE_KEY_PREFIX``.\n* ``cache_alias``. Default is ``settings.CACHE_MIDDLEWARE_ALIAS``, or ``settings.DEFAULT_CACHE_ALIAS`` if set to ``None``.\n* ``cache_min_age``. Default is ``settings.DJANGOCACHE_MIN_AGE``.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install --upgrade django-cache\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenskiy%2Fdjango-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenskiy%2Fdjango-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenskiy%2Fdjango-cache/lists"}