#4992: Alter cache key based on GET parameters ---------------------------------------------+------------------------------ Reporter: anonymous | Owner: nobody Status: reopened | Milestone: post-1.0 Component: Cache system | Version: SVN Resolution: | Keywords: Stage: Design decision needed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------------------+------------------------------ Comment (by Daniel Pope <[EMAIL PROTECTED]>):
Restricting this to a subset of the GET parameters would only reduce the number of duplicate copies in the cache. As such I think it's more beneficial to provide transparent caching with a simple decorator API. The reason we need to use {{{request.get_full_path()}}} is that the current behaviour allows Django to serve the wrong page for requests with a query string. Trying to reduce the number of duplicate entries in the cache to the bare minimum is more of a wishlist item. Rather than building all of the possible ways you could generate cache keys into decorators, why not just allow {{{cache_page}}} to take a callable? eg. {{{ @cache_page(key=lambda request: request.path) def slashdot_this(request): ... }}} This should still default to {{{request.get_full_path()}}} so that the default behaviour works for all views. -- Ticket URL: <http://code.djangoproject.com/ticket/4992#comment:11> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---