Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Docs for @last_modified

  • Loading branch information...
commit 2e37a9666707ee2f54e35f557d53b635dab7d357 1 parent cfa86b2
@Suor authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 docs/decorators.rst
View
15 docs/decorators.rst
@@ -69,3 +69,18 @@ View decorators
return {'success': True, 'data': posts}
For higher order tool see :ref:`ajax`
+
+
+.. function:: @last_modified
+
+ Adds ``Last-Modified`` header with current time to view response.
+ Meaned to be used with ``CommonMiddleware`` and caching to produce
+ ``403 Not Modified`` responses::
+
+ from django.views.decorators.cache import cache_page
+ from handy.decorators import last_modified
+
+ @cache_page(60 * 15)
+ @last_modified
+ def my_view(request):
+ ...
Please sign in to comment.
Something went wrong with that request. Please try again.