diff --git a/django/views/decorators/cache.py b/django/views/decorators/cache.py
index bba7cd9..577c1dd 100644
a
|
b
|
|
1 | | """ |
2 | | Decorator for views that tries getting the page from the cache and |
3 | | populates the cache if the page isn't in the cache yet. |
4 | | |
5 | | The cache is keyed by the URL and some data from the headers. Additionally |
6 | | there is the key prefix that is used to distinguish different cache areas |
7 | | in a multi-site setup. You could use the sites.get_current().domain, for |
8 | | example, as that is unique across a Django project. |
9 | | |
10 | | Additionally, all headers from the response's Vary header will be taken into |
11 | | account on caching -- just like the middleware does. |
12 | | """ |
13 | | |
14 | 1 | try: |
15 | 2 | from functools import wraps |
16 | 3 | except ImportError: |
… |
… |
from django.middleware.cache import CacheMiddleware
|
22 | 9 | |
23 | 10 | |
24 | 11 | def cache_page(*args, **kwargs): |
| 12 | """ |
| 13 | Decorator for views that tries getting the page from the cache and |
| 14 | populates the cache if the page isn't in the cache yet. |
| 15 | |
| 16 | The cache is keyed by the URL and some data from the headers. |
| 17 | Additionally there is the key prefix that is used to distinguish different |
| 18 | cache areas in a multi-site setup. You could use the |
| 19 | sites.get_current().domain, for example, as that is unique across a Django |
| 20 | project. |
| 21 | |
| 22 | Additionally, all headers from the response's Vary header will be taken |
| 23 | into account on caching -- just like the middleware does. |
| 24 | """ |
25 | 25 | # We need backwards compatibility with code which spells it this way: |
26 | 26 | # def my_view(): pass |
27 | 27 | # my_view = cache_page(my_view, 123) |