First time here? Check out the FAQ!
0

Why cache within the object?
 

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!

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
kate_r's avatar
107
kate_r
asked 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
link

Comments

see more comments