>
> So, my main issue with both cache.ram and cache.redis is that new id 
> representation never get added to the dict "permanently". In case of 
> cache.ram, the issue may come from what Anthony explain because I use 
> uwsgi/nginx. But I have made some test with redis and the issue still 
> there, but may still be there for a differents reasons, I don't know. I 
> mean if I update the Redis cached dict from shell, and I try to retrieve 
> the representation passing the key to the dict it works, but it looks like 
> this only works in shell. In case of Redis, I may have to recompute the 
> whole dict base on what you explain, which will not provide any performance 
> improvement if it the case, because what I try to prevent it exactly the 
> creation of the dictionary which requires a lot of computing for nothing 
> each time a new record get created. There maybe something I don't 
> understand about how to refresh Redis cache or in what you explained.
>

The point is that when you retrieve something cached anywhere but RAM, you 
are getting a *copy* of the object. If you then update that copy in your 
Python code, that does nothing to update the value that is stored in the 
cache. So, if you want to update the cached value, you have to explicitly 
put the new copy of the entire object back into the cache.

Anthony


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to