class jinja2.bccache.FileSystemBytecodeCache(directory=None, pattern='__jinja2_%s.cache')[source]

A bytecode cache that stores bytecode on the filesystem. It accepts two arguments: The directory where the cache items are stored and a pattern string that is used to build the filename.

If no directory is specified a default cache directory is selected. On Windows the user’s temp directory is used, on UNIX systems a directory is created for the user in the system temp directory.

The pattern can be used to have multiple separate caches operate on the same directory. The default pattern is '__jinja2_%s.cache'. %s is replaced with the cache key.

>>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')

This bytecode cache supports clearing of the cache using the clear method.


__init__([directory, pattern])
get_bucket(environment, name, filename, source) Return a cache bucket for the given template.
get_cache_key(name[, filename]) Returns the unique hash key for this template name.
get_source_checksum(source) Returns a checksum for the source.
set_bucket(bucket) Put the bucket into the cache.