> That's why i asked on what Django uses as a key to set and entry in the cache.
> If i generate the page and put it on the cache and then rely on Django to get 
> it,
> the key i use needs to be the same as Django uses otherwise the page isn't 
> found in the
> cache and the page is generated again and then cached by Django.
> And that's just what i want to avoid.
> I'm happy to leave the caching to Django, i just want to "help" cache it 
> initially :)

 OK - now I see what you're trying to achieve :)

 What is slow for you? Is it the data calculation, or actualy
constructing the HTML page from the data (read:context) and page
template?

  If it's the former, I'd still cache inside the function that
calculates the data (with a fixed string key) to get the "transparency
of the program". Using the "hack" with the cache key you plan to use
sounds clever, but a bit difficult to pick up if someone else needs to
read and understand the code later.

  Just my 2 cents :)

    Jirka

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to