{ "info": { "author": "Lorenzo Setale ( http://who.is.lorenzo.setale.me/? )", "author_email": "koalalorenzo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)" ], "description": "# django-smartcc\nSet some cache-related headers automatically, defining not-authenticated\nrequests as public and authenticated requests as private. You can also customize these values for specific URLs. This middleware class will also setup these HTTP headers:\n\n* Vary\n* Cache-Control\n* Expires\n\nThis middleware works and is designed to integrate Django with CloudFlare Cache (or similar services). Used in production on MinbilDinbil.dk servers. \n\n## Installation\nAdd django-smartcc on your requirements.txt file or just launch:\n\n pip install -U django-smartcc\n \nThen add django-smartcc in the installed apps and in the middleware, so add these line in your settings.py file.\n\n # settings.py\n INSTALLED_APPS += [\n 'smart_cache_control',\n ]\n \n MIDDLEWARE_CLASSES += [\n 'smart_cache_control.middleware.SmartCacheControlMiddleware'\n ]\n\n**Note**: Remember that this middleware requires authentication, so it should be loaded after the *django.contrib.auth.middleware.AuthenticationMiddleware*!\n \n\n## Customization and Settings\nYou can customize a specific Cache-control value on each URL. For example\nif we want to avoid cache on */hello/* , but always have it on */api/search* for 5 minutes, we should write this in our settings file:\n\n # settings.py\n SCC_CUSTOM_URL_CACHE = (\n (r'/hello/$', 'private', 0),\n (r'/api/search$', 'public', 300),\n )\n\nOther options are available to customize the behaviour of the middleware:\n\n**SCC_SET_VARY_HEADER**: Define if the middleware have to set the Vary header.\n Default value: *True*\n\n**SCC_SET_EXPIRE_HEADER**: Define if the middleware should set the Expires\n header. Default value: *True*\n\n**SCC_MAX_AGE_PUBLIC**: Define the default max-age value in seconds for public\n requests. Default value: *86400*\n\n**SCC_MAX_AGE_PRIVATE**: Define the default max-age value in seconds for\n private requests. Default value: *0*", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/koalalorenzo/django-smartcc", "keywords": null, "license": "GPL v2", "maintainer": null, "maintainer_email": null, "name": "django-smartcc", "package_url": "https://pypi.org/project/django-smartcc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-smartcc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/koalalorenzo/django-smartcc" }, "release_url": "https://pypi.org/project/django-smartcc/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A django Middleware that will help to set cache-control header on the views.", "version": "0.1.2" }, "last_serial": 1418998, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "9a3417b8ebd19e4e65ec94c469011a26", "sha256": "1de253894e0cb32f04651cd193107bcdea82e6d4fd791e3797de75bcba325f58" }, "downloads": -1, "filename": "django-smartcc-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a3417b8ebd19e4e65ec94c469011a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2632, "upload_time": "2015-02-11T08:57:58", "url": "https://files.pythonhosted.org/packages/78/cf/68b694b9495db7904aa28304dc7d73ef0de299cc0b75d3c705d488a96eaa/django-smartcc-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9a3417b8ebd19e4e65ec94c469011a26", "sha256": "1de253894e0cb32f04651cd193107bcdea82e6d4fd791e3797de75bcba325f58" }, "downloads": -1, "filename": "django-smartcc-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a3417b8ebd19e4e65ec94c469011a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2632, "upload_time": "2015-02-11T08:57:58", "url": "https://files.pythonhosted.org/packages/78/cf/68b694b9495db7904aa28304dc7d73ef0de299cc0b75d3c705d488a96eaa/django-smartcc-0.1.2.tar.gz" } ] }