=== modified file 'django/conf/global_settings.py'
--- django/conf/global_settings.py	2007-04-11 03:35:58 +0000
+++ django/conf/global_settings.py	2007-04-11 04:43:58 +0000
@@ -275,6 +275,7 @@
 # possible values.
 CACHE_BACKEND = 'simple://'
 CACHE_MIDDLEWARE_KEY_PREFIX = ''
+CACHE_MIDDLEWARE_SECONDS = 60 * 10
 
 ####################
 # COMMENTS         #

=== modified file 'django/utils/decorators.py'
--- django/utils/decorators.py	2006-12-19 04:35:09 +0000
+++ django/utils/decorators.py	2007-04-11 21:27:58 +0000
@@ -1,12 +1,12 @@
 "Functions that help with dynamically creating decorators for views."
 
-def decorator_from_middleware(middleware_class):
-    """
-    Given a middleware class (not an instance), returns a view decorator. This
-    lets you use middleware functionality on a per-view basis.
-    """
-    def _decorator_from_middleware(view_func, *args, **kwargs):
-        middleware = middleware_class(*args, **kwargs)
+def make_decorator_from_middleware(middleware_class, *deco_args,
+                                   **deco_kwargs):
+    """
+    A decorator factory that returns a decorator from a middleware class.
+    """
+    def _decorator_from_middleware(view_func):
+        middleware = middleware_class(*deco_args, **deco_kwargs)
         def _wrapped_view(request, *args, **kwargs):
             if hasattr(middleware, 'process_request'):
                 result = middleware.process_request(request)
@@ -31,3 +31,22 @@
             return response
         return _wrapped_view
     return _decorator_from_middleware
+
+def decorator_from_middleware(middleware_class):
+    """
+    Given a middleware class (not an instance), returns a view decorator. This
+    lets you use middleware functionality on a per-view basis.
+    """
+    return make_decorator_from_middleware(middleware_class)
+
+def decorator_with_arguments_from_middleware(middleware_class):
+    """
+    Given a middleware class (not an instance), return a function that,
+    when called, returns a view decorator.  This lets you use middleware
+    functionality on a per-view basis for middleware classes whose
+    contructors take arguments.
+    """
+    def _decorator_factory(*deco_args, **deco_kwargs):
+        return make_decorator_from_middleware(middleware_class, *deco_args,
+                                              **deco_kwargs)
+    return _decorator_factory

=== modified file 'django/views/decorators/cache.py'
--- django/views/decorators/cache.py	2006-12-19 04:35:09 +0000
+++ django/views/decorators/cache.py	2007-04-11 05:31:23 +0000
@@ -11,11 +11,11 @@
 account on caching -- just like the middleware does.
 """
 
-from django.utils.decorators import decorator_from_middleware
+from django.utils.decorators import decorator_with_arguments_from_middleware
 from django.utils.cache import patch_cache_control, add_never_cache_headers
 from django.middleware.cache import CacheMiddleware
 
-cache_page = decorator_from_middleware(CacheMiddleware)
+cache_page = decorator_with_arguments_from_middleware(CacheMiddleware)
 
 def cache_control(**kwargs):
 

=== modified file 'docs/cache.txt'
--- docs/cache.txt	2007-03-28 01:14:50 +0000
+++ docs/cache.txt	2007-04-11 06:09:17 +0000
@@ -274,7 +274,7 @@
     def slashdot_this(request):
         ...
 
-    slashdot_this = cache_page(slashdot_this, 60 * 15)
+    slashdot_this = cache_page(60 * 15)(slashdot_this)
 
 Or, using Python 2.4's decorator syntax::
 
@@ -282,7 +282,14 @@
     def slashdot_this(request):
         ...
 
-``cache_page`` takes a single argument: the cache timeout, in seconds. In the
+``cache_page`` can be passed the following optional arguments:
+ * ``cache_timeout`` - the cache timeout in seconds.  Defaults to 
+   ``settings.CACHE_MIDDLEWARE_SECONDS``, which defaults to 600 seconds
+   (10 minutes).
+ * ``key_prefix`` - the prefix to use for cache keys.  Defaults to
+   ``settings.CACHE_MIDDLEWARE_KEY_PREFIX``, which defaults to ``''``.
+ * ``cache_anonymous_only`` - if True, only cache anonymous requests. Defaults
+   to ``setings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY``.
 above example, the result of the ``slashdot_this()`` view will be cached for 15
 minutes.
 

