Ask Your Question

Why cache within the object?

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

kate_r's avatar


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

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


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

Evgeny's avatar

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


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

Seen: 70 times

Last updated: Jun 07 '13