At http://code.djangoproject.com/ticket/603 Jacob wrote:

"Yes, actually -- turns out that the cost of a cache miss is *more*
than the cost of compiling a template (we profiled this about a year
ago, so it may have changed in the meantime). So it turns out it's
easier to just parse the template when it's needed."

This made me think about the more general question: When is it
appropriate to cache a page or object? How many cache hits does it take
to make up for the cost of caching? Obviously this depends on the
complexity of the cached object -- say we cache the result of a rather
simple function which includes one or two sql queries (using
memcached): How many cache hits would it take for this to make sense?

Andreas

Reply via email to