Setting Mako Cache defaults from Pyramid app

62 views
Skip to first unread message

Максим Коринец

unread,
Oct 15, 2011, 2:53:53 PM10/15/11
to pylons-...@googlegroups.com
Hello everyone!

I found out recently that Mako has a nice cache mechanism. Its simple like
<%block cached="True">
              ... some expensive call ...
</%block> 
 I can set all the rest required attributes (like cache_timeout="86400" cache_type="file" cache_dir="cache") in that block tag, but I want to set them in pyramid __init__.py to be global for all my cached block. In Mako docs there is a section on cache arguments and as top-level object to set cache defaults to is Template. As I am new to Pyramid and Mako, I can't figure out how do I access the Mako.Template object. Ok I know how to set mako.directories and thats all. 

Can someone point me in right direction?

Chris McDonough

unread,
Oct 15, 2011, 3:02:56 PM10/15/11
to pylons-...@googlegroups.com

I don't think the options exist in the Pyramid bindings to set caching
values for all Mako renderers like this, sorry.

- C

Reply all
Reply to author
Forward
0 new messages