diff -r a7be18090928 django/templatetags/cache.py
--- a/django/templatetags/cache.py	Tue Jun 10 02:52:16 2008 +0000
+++ b/django/templatetags/cache.py	Sun Jun 15 23:00:13 2008 +0200
@@ -16,6 +16,7 @@
         # Build a unicode key for this fragment and all vary-on's.
         cache_key = u':'.join([self.fragment_name] + \
             [force_unicode(resolve_variable(var, context)) for var in self.vary_on])
+        cache_key = cache_key.replace(" ", "_")
         value = cache.get(cache_key)
         if value is None:
             value = self.nodelist.render(context)
