Skip to content

Commit

Permalink
- bumped magic number, which forces template recompile for
Browse files Browse the repository at this point in the history
this version (fixes incompatible compile symbols from 0.1
series).
- added a few docs for cache options, specifically those that
help with memcached.
  • Loading branch information
zzzeek committed Jun 16, 2008
1 parent 0b9c201 commit df8dc27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
0.2.1
- fixed bug where 'output_encoding' parameter would prevent
render_unicode() from returning a unicode object
render_unicode() from returning a unicode object.
- bumped magic number, which forces template recompile for
this version (fixes incompatible compile symbols from 0.1
series).
- added a few docs for cache options, specifically those that
help with memcached.

0.2.0
- Speed improvements (as though we needed them, but people
Expand Down
4 changes: 3 additions & 1 deletion doc/build/content/caching.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ The options available are:

* cached="False|True" - turn caching on
* cache_timeout - number of seconds in which to invalidate the cached data. after this timeout, the content is re-generated on the next call.
* cache_type - type of caching. `memory`, `file`, `dbm`, or `memcached`. (TODO: describe extra arguments for memcached)
* cache_type - type of caching. `memory`, `file`, `dbm`, or `memcached`.
* cache_url - (only used for `memcached` but required) a single IP address or a semi-colon separated list of IP address of memcache servers to use.
* cache_dir - In the case of the `file` and `dbm` cache types, this is the filesystem directory with which to store data files. If this option is not present, the value of `module_directory` is used (i.e. the directory where compiled template modules are stored). If neither option is available an exception is thrown.
In the case of the `memcached` type, this attribute is required and it's used to store the lock files.
* cache_key - the "key" used to uniquely identify this content in the cache. the total namespace of keys within the cache is local to the current template, and the default value of "key" is the name of the def which is storing its data. It is an evaluable tag, so you can put a Python expression to calculate the value of the key on the fly. For example, heres a page that caches any page which inherits from it, based on the filename of the calling template:

<%page cached="True" cache_key="${self.filename}"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/mako/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mako.pygen import PythonPrinter
from mako import util, ast, parsetree, filters

MAGIC_NUMBER = 2
MAGIC_NUMBER = 3


def compile(node, uri, filename=None, default_filters=None, buffer_filters=None, imports=None, source_encoding=None, generate_unicode=True):
Expand Down

0 comments on commit df8dc27

Please sign in to comment.