{ "info": { "author": "Eric Davis", "author_email": "ed@npri.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Internet" ], "description": "django-last-modified\n ====================\n \n .. image:: https://secure.travis-ci.org/edavis/django-last-modified.png\n :target: https://travis-ci.org/edavis/django-last-modified\n \n django-last-modified is a collection of Django middleware to help\n manage your caching setup.\n \n If you're familiar with the following HTTP headers:\n \n - Cache-Control\n - Expires\n - Last-Modified\n - ETag\n - If-Modified-Since\n - If-None-Match\n \n You can probably skip down to \"Installation.\"\n \n Otherwise, you can find a primer on HTTP caching located `here\n `_.\n \n Installation\n ------------\n \n 1) ``$ pip install django-last-modified``\n \n 2) Add ``CacheControlMiddleware`` and ``LastModifiedMiddleware`` to\n MIDDLEWARE_CLASSES.\n \n ``CacheControlMiddleware`` adds the Cache-Control and Expires headers\n to outgoing responses while ``LastModifiedMiddleware`` adds the\n Last-Modified/ETag header and performs the\n If-Modified-Since/If-None-Match checking.\n \n Here's a recommended MIDDLEWARE_CLASSES order:\n \n .. code-block:: python\n \n MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'last_modified.middleware.LastModifiedMiddleware',\n 'last_modified.middleware.CacheControlMiddleware',\n # ... snip ...\n )\n \n If a request is authenticated (i.e., the user has logged in) the\n If-Modified-Since checking is skipped.\n \n django-last-modified doesn't need to be added to INSTALLED_APPS.\n \n Configuration\n -------------\n \n LAST_MODIFIED_FUNC\n String path to a function (e.g., 'path.to.module.function') that\n is called to obtain the \"last modified\" value. Must return either a\n datetime/date object or a UNIX timestamp. *Default:* None, must be\n defined.\n \n CACHE_MAX_AGE\n Number of seconds stored representation is considered fresh for\n private caches. *Default:* 3600 seconds (one hour).\n \n CACHE_SHARED_MAX_AGE\n Same as CACHE_MAX_AGE but for public caches. *Default:* Value of\n CACHE_MAX_AGE.\n \n DISABLE_CACHE_CONTROL_MIDDLEWARE, DISABLE_LAST_MODIFIED_MIDDLEWARE\n Set to True to disable the respective middleware from being\n applied. Provided so you can toggle middleware off/on without having\n to tweak MIDDLEWARE_CLASSES. *Default:* False.\n \n Doesn't Django already have this?\n ---------------------------------\n \n Django has two features *like* this, but they're slightly different.\n \n The `update and fetch\n `_\n cache middleware sets the Cache-Control, Expires, and Last-Modified\n headers but in the process also stores the generated pages in the\n server-side cache. The project I was working on had many thousand\n \"long-tail\" pages that I didn't want/need polluting any caches.\n \n There's also \"`conditional view processing\n `_\"\n which is even closer to what I needed, but can only be applied on a\n per-view basis while I needed the whole site covered.\n \n In a nutshell, I wanted the whole site covered (like the cache\n middleware does) but only generating HTTP headers and not involving\n the server-side cache (like the conditional view processing).\n \n Unable to find an existing app to do this, django-last-modified was\n born.\n \n LICENSE\n -------\n \n MIT", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/edavis/django-last-modified", "keywords": "cache,if-modified-since,last-modified,cache-control,expires,etag,if-none-match", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-last-modified", "package_url": "https://pypi.org/project/django-last-modified/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-last-modified/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/edavis/django-last-modified" }, "release_url": "https://pypi.org/project/django-last-modified/0.1/", "requires_dist": null, "requires_python": null, "summary": "Django middleware to help manage your caching setup", "version": "0.1" }, "last_serial": 748595, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5622079f37948501c9156e0d60890ebc", "sha256": "98c96b10ba87d8a3f62c5dbfdf71d38bb16e320b478cceeee2c2758cee058f74" }, "downloads": -1, "filename": "django-last-modified-0.1.tar.gz", "has_sig": false, "md5_digest": "5622079f37948501c9156e0d60890ebc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5014, "upload_time": "2012-11-19T23:42:02", "url": "https://files.pythonhosted.org/packages/df/9f/85bf797cf08c8d1d833638cfe4340d75e05b8d6041c0ce19cca7b1e5525d/django-last-modified-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5622079f37948501c9156e0d60890ebc", "sha256": "98c96b10ba87d8a3f62c5dbfdf71d38bb16e320b478cceeee2c2758cee058f74" }, "downloads": -1, "filename": "django-last-modified-0.1.tar.gz", "has_sig": false, "md5_digest": "5622079f37948501c9156e0d60890ebc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5014, "upload_time": "2012-11-19T23:42:02", "url": "https://files.pythonhosted.org/packages/df/9f/85bf797cf08c8d1d833638cfe4340d75e05b8d6041c0ce19cca7b1e5525d/django-last-modified-0.1.tar.gz" } ] }