Caching query results in django

Posted by Marcio Cruz on Stack Overflow See other posts from Stack Overflow or by Marcio Cruz
Published on 2011-01-08T01:42:51Z Indexed on 2011/01/08 1:54 UTC
Read the original article Hit count: 579

Filed under:
|

I'm trying to find a way to cache the results of a query that won't change with frequency. For example, categories of products from an e-commerce (cellphones, TV, etc). I'm thinking of using the template fragment caching, but in this fragment, I will iterate over a list of these categories. This list is avaliable in any part of the site, so it's in my base.html file. Do I have always to send the list of categories when rendering the templates? Or is there a more dynamic way to do this, making the list always available in the template?

© Stack Overflow or respective owner

Related posts about django

Related posts about caching