If your web server runs multiple workers in separate processes (e.g., the 
uwsgi setup here 
<https://github.com/web2py/web2py/blob/4ed36cfb1fe960d5c818c53562d920d407e991ae/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L168>),
 
then each process will have its own cache.ram and loaded routes. If you 
need to make sure the cached value is the same in all processes at all 
times, you might instead consider the Redis cache option. As for routes, 
better to restart the web server to reload routes.

Anthony

On Friday, May 4, 2018 at 4:48:55 AM UTC-4, mweissen wrote:
>
> I use the example from the book and change the time to 60 seconds:
>
> ​def cache_in_ram():
>     import time
>     t = cache.ram('time', lambda: time.ctime(), time_expire=60)
>     return locals()
>
> ​Now I call this function rapidly during the cache-time (60 seconds). It 
> should show always the same time - but it does not! On my machine it shows 
> 4 different times. 
>
> If I change from cache.ram to cache.disk every calls looks like expected. 
> Therefore  I think it is a problem of the RAM-management of the virtual 
> server. 
>
> Next problem:
>
> I use routes.py for a simle rerouting. After some modifications I press 
> the reload button for the routes and try the new routes. And now sometime 
> the new routes work, sometime the old routes. I push the reload-button more 
> than 30 times and now every call goes to the new routes. It seems that this 
> is similar to the cache.ram problem. I did not find whether routes uses 
> cache.ram, but if it does: is it possible to change it to cache.disk?
>
> Any ideas?
>
> Regards, Martin
>

-- 
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