managing the collection's template cache

Each collection controls its own cache, customizable via two parameters that get their default values from the domain:

  • cache_size: int = 0
    sets the maximum number of loaded templates in a collection, with a value of 0 meaning no limit.
  • auto_reload: int = 60
    sets the minimum number of seconds to wait before doing a stat on the template file to see if it has been modified. A value of 0 means to do the file system check on each request for the template.

The collection cache is always on.

If you prefer to run like there was no cache, i.e. reloading every template each time it is requested, you can set cache_size=1 and auto_reload=0.

If, on the other hand, you would like to run such that templates are virtually never reloaded, you can set cache_size=0 and auto_reload=60*60*24, i.e. a sufficiently large number of seconds to wait between checks.