#11270 closed (fixed)
Cache templatetag with memcached can't handle long tags
Reported by: | 235 | Owned by: | nobody |
---|---|---|---|
Component: | Core (Cache system) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
similar to #10016
Memcached has a hard limit of 250 characters for cache keys.
So we have to use md5 hash instead of the whole cached tag name with all vary variables.
Traceback (most recent call last): File "/var/www/virtual/sumno.com/modules/django/core/handlers/base.py", line 86, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/var/www/virtual/sumno.com/htdocs/sumnocom/apps/lib/decorators.py", line 56, in wrapper return func(request, *args, **kwargs) File "/var/www/virtual/sumno.com/htdocs/sumnocom/../sumnocom/apps/generic_content/views.py", line 370, in detail_view_content_entry context_instance=RequestContext(request)) File "/var/www/virtual/sumno.com/modules/django/shortcuts/__init__.py", line 18, in render_to_response return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/var/www/virtual/sumno.com/modules/django/template/loader.py", line 107, in render_to_string return t.render(context_instance) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 176, in render return self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/template/loader_tags.py", line 97, in render return compiled_parent.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 176, in render return self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/template/loader_tags.py", line 97, in render return compiled_parent.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 176, in render return self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/template/loader_tags.py", line 24, in render result = self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/htdocs/sumnocom/apps/lib/templatetags/smartspaceless.py", line 17, in render s = self.nodelist.render(context).strip() File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/template/loader_tags.py", line 24, in render result = self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/template/loader_tags.py", line 24, in render result = self.nodelist.render(context) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 768, in render bits.append(self.render_node(node, context)) File "/var/www/virtual/sumno.com/modules/django/template/__init__.py", line 781, in render_node return node.render(context) File "/var/www/virtual/sumno.com/modules/django/templatetags/cache.py", line 27, in render value = cache.get(cache_key) File "/var/www/virtual/sumno.com/modules/django/core/cache/backends/memcached.py", line 25, in get val = self._cache.get(smart_str(key)) File "/var/lib/python-support/python2.5/memcache.py", line 619, in get check_key(key) File "/var/lib/python-support/python2.5/memcache.py", line 885, in check_key % SERVER_MAX_KEY_LENGTH) MemcachedKeyLengthError: Key length is > 250
Attachments (1)
Change History (7)
by , 16 years ago
Attachment: | cache_templatetag.patch added |
---|
comment:1 by , 16 years ago
milestone: | → 1.1 |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
If Jacob thought #10016 was 1.1 worthy, this should be too.
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
comment:4 by , 16 years ago
comment:5 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
django/templatetags/cache.py patch