Re: page caching in mako and pylons
On Aug 10, 2007, at 5:42 PM, SamDonaldson wrote: Aside from page caching...is there fragment caching? In other words...page caching doesn't really help when you have a header on your page with logged in users etc. You can't serve that page. Is there a way, like Rails, to fragment cache parts of your template? You bet, you can cache any part of your templates (their fragments), and you can cache function calls as well. This extends not just throughout Mako, but into Pylons as well, where you can register functions in your controllers to be cached, like the example in the docs here: http://wiki.pylonshq.com/display/pylonsdocs/Caching+in+Templates+and +Controllers In the cache object example, an entire function is handed to the caching system, which can handle any object/output that can be pickled. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: page caching in mako and pylons
On Sat, 2007-08-11 at 11:19 -0700, Ben Bangert wrote: You bet, you can cache any part of your templates (their fragments), and you can cache function calls as well. This extends not just throughout Mako, but into Pylons as well, where you can register functions in your controllers to be cached, like the example in the docs here: http://wiki.pylonshq.com/display/pylonsdocs/Caching+in+Templates+and +Controllers In the cache object example, an entire function is handed to the caching system, which can handle any object/output that can be pickled. Is there some way to verify that caching is working (aside from turning up database logging that is)? Cliff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: page caching in mako and pylons
On Sat, 2007-08-11 at 16:25 -0700, Cliff Wells wrote: Is there some way to verify that caching is working (aside from turning up database logging that is)? Nevermind. I got it. Also, it would be useful if Memcached support were added as an option. An interesting article here: http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/ It talks mostly about RoR, but the concept is generally applicable. Regards, Cliff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
page caching in mako and pylons
Hello, I installed the memcached client for python and installed memcached server. I'm wondering how page caching would work if I were to do something like this: %page cached=True cache_type=memcached/ .. % end % How does Mako know where my memcached server is located? Can I give this declaration a timeout as a param? How do I check whether there's a cached copy for that fragment in the controller action to avoid repeating any backend queries if the fragment is already cached in memcached? Thanks for you help. I'm reading the Mako docs but there's really not much there. Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: page caching in mako and pylons
Aside from page caching...is there fragment caching? In other words...page caching doesn't really help when you have a header on your page with logged in users etc. You can't serve that page. Is there a way, like Rails, to fragment cache parts of your template? Thanks, Sam. On Aug 10, 12:15 pm, Michael Bayer [EMAIL PROTECTED] wrote: sorry, docs are weak in this area. theres a cache_url argument which references a memcached URL, and you apply this argument to the %page or %def tag. im not sure if people have used memcached with Mako yet so let us know how it goes. On Aug 10, 4:29 am, SamDonaldson [EMAIL PROTECTED] wrote: Hello, I installed the memcached client for python and installed memcached server. I'm wondering how page caching would work if I were to do something like this: %page cached=True cache_type=memcached/ .. % end % How does Mako know where my memcached server is located? Can I give this declaration a timeout as a param? How do I check whether there's a cached copy for that fragment in the controller action to avoid repeating any backend queries if the fragment is already cached in memcached? Thanks for you help. I'm reading the Mako docs but there's really not much there. Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---