On 12/6/05, hugo <[EMAIL PROTECTED]> wrote:
> +1 for vary_on_get, that fits nicely into the current scheme and just
> sounds right to me.

Looks like vary_on_get is the most popular choice. So here's how that
might work:

@vary_on_get('id')
def my_view(request):
    id = request.GET.get('id', None)

@vary_on_get('q', 'page')
def search(request):
    q = request.GET.get('q', None)
    page = request.GET.get('page', 1)

In the second example, a request to /search/?foo=bar would use the
cached version of /search/, because "foo" isn't in vary_on_get.

The remaining question is: What's the behavior if vary_on_get() isn't
specified for a particular view? Do we cache everything (including
separate cache entries for any combination of different GET
parameters) or cache nothing (current behavior)?

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to