Ask Your Question
0

Why cache within the object?

asked 2013-06-07 12:50:27 -0600

kate_r gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-07 12:57:06 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-06-07 12:50:27 -0600

Seen: 33 times

Last updated: Jun 07 '13