diff --git a/django/middleware/cache.py b/django/middleware/cache.py
index 34bf0ca..b7f27b3 100644
a
|
b
|
class UpdateCacheMiddleware(object):
|
69 | 69 | self.cache_alias = settings.CACHE_MIDDLEWARE_ALIAS |
70 | 70 | self.cache = get_cache(self.cache_alias) |
71 | 71 | |
| 72 | def process_view(self, request, view_func, view_args, view_kwargs): |
| 73 | if hasattr(view_func, '__cbvclass__') and hasattr(view_func.__cbvclass__, 'cache_timeout'): |
| 74 | request.cache_timeout = view_func.__cbvclass__.cache_timeout |
| 75 | |
72 | 76 | def _session_accessed(self, request): |
73 | 77 | try: |
74 | 78 | return request.session.accessed |
… |
… |
class UpdateCacheMiddleware(object):
|
100 | 104 | # length. |
101 | 105 | timeout = get_max_age(response) |
102 | 106 | if timeout == None: |
103 | | timeout = self.cache_timeout |
| 107 | timeout = getattr(request, 'cache_timeout', self.cache_timeout) |
104 | 108 | elif timeout == 0: |
105 | 109 | # max-age was set to 0, don't bother caching. |
106 | 110 | return response |
diff --git a/django/views/generic/base.py b/django/views/generic/base.py
index f2d4950..42191af 100644
a
|
b
|
class View(object):
|
51 | 51 | # and possible attributes set by decorators |
52 | 52 | # like csrf_exempt from dispatch |
53 | 53 | update_wrapper(view, cls.dispatch, assigned=()) |
| 54 | |
| 55 | # and a reference back to the class |
| 56 | view.__cbvclass__ = cls |
| 57 | |
54 | 58 | return view |
55 | 59 | |
56 | 60 | def dispatch(self, request, *args, **kwargs): |