{ "info": { "author": "Simon de Haan", "author_email": "simon@praekeltfoundation.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "==================================\nDjango Fragment Cache Invalidation\n==================================\n\nFragment cache invalidation by using a per model version token to prefix the cache keys. The version token can either be an internal memcached counter or a timestamped attribute from the model, such as `updated_at`.\n\nInstallation\n------------\n\nInstall with `pip` or with `python setup.py install` and add 'cachesweeper' to your `settings.INSTALLED_APPS`\n\n\npost_save cache sweeper\n-----------------------\n\nAn example setup; an article has many comments, each comment is cached, a single vote should invalidate the comment's specific cached fragment as well as the total article's page.\n \n**Template fragment caching**\n\n`{% cachesweeper %}` takes a Django ORM model as its first argument, the expiry time as its second and any following arguments are used to construct the rest of the cache key\n\n::\n\n {% load markup %}\n {% load cachesweeper_tags %}\n {% cachesweeper comment 500 \"comment.xml\" %}\n
\n {{comment.user}} said at {{comment.created_at}}:
\n {{comment.content|markdown}}\n
\n Like ({{comment.likes.count}})\n Dislike ({{comment.dislikes.count}})\n