First time here? Check out the FAQ!
0

Why cache within the object?

  • retag add tags

Hi

It seems that some cacheable content is cached within the object rather than in the cache system - why's that? For instance:

# post.py
def set_cached_comments(self, comments):
    """caches comments in the lifetime of the object
    does not talk to the actual cache system
    """
    self._cached_comments = comments

Thanks!

kate_r's avatar
107
kate_r
asked 2013-06-07 12:50:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

This kind of cache is just a reference to some value that was calculated during the request cycle. It will not be carried over to the next cycle.

Evgeny's avatar
13.2k
Evgeny
answered 2013-06-07 12:57:06 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments