* owner: nobody => Horst Gutmann <zerok@…>
* ui_ux: => 0
* easy: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:5>
Comment (by frearkvanderbos):
The part of the patch relating to the template cache key seems a-okay to
me. However the middleware cache key portion sits uneasy with me since it
mentions that it documents potentially unstable internals.
I wonder if this is in fact true. Parts of the key are generated with
functions starting with an underscore, but from the outside it is
generated with a single call to utils.cache.get_cache_key . I would assume
that this functions output is stable. Considering that, I think the note
about the key being potentially unstable could be remove.
Probably best that someone else also mentioned an opinion about that. :)
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:6>
* keywords: => dceu2011
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:7>
Comment (by aaugustin):
Paraphrasing the cache key generation code in the docs, like this patch
does, sounds inefficient to me. If a developer wants to determine a cache
key, what is (s)he supposed to do: roll his own implementation, based on
the docs? That doesn't make sense: the reference implementation is right
there in Django!
In my opinion, the proper way to resolve this problem is to specify a
public, stable API for computing cache keys, and document that.
This solution is:
- user friendly: it involves less work for developers who need this
feature,
- developer friendly: we keep the freedom to change the underlying
implementation if it contains design bugs, for instance if it's vulnerable
to collisions under some circumstances (this example is gross, but you get
the idea). For this reason, I'm afraid that the cure proposed by the
current patch is worse than the disease :)
Does someone else have an opinion on this? (I won't touch the flags until
I have more feedback.)
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:8>
* owner: Horst Gutmann <zerok@…> =>
* needs_better_patch: 0 => 1
Comment:
@aaugustin: I totally agree with you. The patch I posted was originally a
quick-shot and I intended to re-think it and talk with Russell or Jannis
about this during the DjangoCon EU sprints about it, but sadly other
things came in the way and I forgot about this issue. Sorry for that :-(
I'm all for making the cache-key generation part of a public API. I've
updated the flags and removed myself as owner since I probably won't have
time to actually do the implementation.
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:9>
Comment (by timo):
It looks to me like #19320 is a suggestion (with a patch) for public cache
API as discussed above. Perhaps we should close this ticket as a duplicate
of that one?
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:10>
* status: new => closed
* resolution: => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/9334#comment:11>