Caching - need your thoughts

69 views
Skip to first unread message

Kiran Subbaraman

unread,
Sep 30, 2015, 8:22:43 AM9/30/15
to web2py-users
Hello group,
I have a standard web2py application, but within its modules directory, I have a bunch of code which run within the web2py context (and its scheduler), and also as scripts independent of web2py. It is just that this code resident within web2py's modules.
I wanted to use the web2py caching capability within some of these scripts, and soon realized that they are dependent on the web2py context. A couple of questions:
  • So, I cannot use the cache module independent of web2py's running context. Is this a fair assumption? If not, any suggestions on how I can use this cache module will help.
  • Less important question: Ended up searching for python based caches, and I came across Beaker, and Dogpile, among others. Before I decide on what to do about my cache requirement, I thought I'll reach out to the community to see if there are any viewpoints on either of these projects?

Thank you,

Kiran

Richard Vézina

unread,
Sep 30, 2015, 9:34:00 AM9/30/15
to web2py-users
About Cache, you may try to import gluon cache.py module and see if it can solve you requirement. 

Something like that :

from cache import CacheInRam, CacheOnDisk, Cache

You may need to include it in python path...

Richard

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Vézina

unread,
Sep 30, 2015, 9:35:33 AM9/30/15
to web2py-users

Kiran Subbaraman

unread,
Sep 30, 2015, 11:56:29 PM9/30/15
to web...@googlegroups.com
Richard,
Thanks a lot for the pointers. The cache test code provided the information I needed.
I had tried to look for answers only in the group and docs.
Note to self: Look at the groups, docs, source and test codebase, before posting a question
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
Reply all
Reply to author
Forward
0 new messages