The cache module

Cache logic.

class ImageEntry(image)[source]

Bases: object

class ImageCache[source]

Bases: object

Cache generated images.

Store and retrieve them under a key (see render.Renderer.key()).

maxsize = 209715200
currentsize = 0

Remove all cached images.


Clear cache contents for the specified page.


Return a dictionary with tile-entry pairs for the key.

If no single tile is available, an empty dict is returned.

addtile(key, tile, image)[source]

Add image for the specified key and tile.


Iterate over suitable image tilesets but with a different size.

Yields (width, height, tileset) tuples.

This can be used for interim display while the real image is being rendered.