Hello Simone,

Thanks to jump in this thread... I understand what you say... The thing is
I need this dict to be global and I though it could be more clean to have
these dict create and update by the same function.

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.



On Wed, Jan 13, 2016 at 4:56 PM, Niphlod <[email protected]> wrote:

> errata corrige on BTW2: on redis, time_expire=None results in key stored
> at most one day. you can always do time_expire=30*24*60*60 for 30days worth.
>
> things_to_know: only cache.disk and cache.ram can effectively cache a
> value indefinitely and enable that strange behaviour of retrieving the
> previously cached element - that you marked to expire after 5 seconds - one
> day later.
> Web2py's cache API is effectively incompatible with any high-performance
> caching system, unless the user calls upon himself the burden of clearing
> the cache regularly (which is never the case because cache invalidation is
> one of the hardest things to master).
> Both memcache and redis take a more strict behaviour, i.e. the value will
> effectively expire at the time it was set on the first time. So, you can
> only fetch a cached value one day later if you originally marked it as
> expiring one day later. Redis allows a leeway of 120 seconds to accomodate
> the 90% of the behavioural usecases of cache.ram and cache.disk.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to