Aeros.caching

This module contains features for server-side and client-side caching.

Package Contents

Classes

SimpleCache

The most basic cache that requires no set-up and no arguments.

FileSystemCache

Stores cached responses on the file system,

FilesystemCache

An alias for FileSystemCache

RedisCache

A Redis client to store responses on an external Redis server.

CacheControl

This class manipulates the Cache-Control header in all responses sent from an endpoint

CacheTypes

An enum to replace the cache option strings with variables for auto-complete in most IDEs.

class Aeros.caching.SimpleCache(app: Optional[Flask] = None, with_jinja2_ext: bool = True, config=None)[source]

Bases: flask_caching.Cache

The most basic cache that requires no set-up and no arguments.

class Aeros.caching.FileSystemCache(app: Optional[Flask] = None, with_jinja2_ext: bool = True, config=None)

Bases: flask_caching.Cache

Stores cached responses on the file system, good for huge caches that don’t fit into memory.

class Aeros.caching.FilesystemCache[source]

An alias for FileSystemCache

Warning

This class is deprecated! Use FileSystemCache instead.

class Aeros.caching.RedisCache(app: Optional[Flask] = None, with_jinja2_ext: bool = True, config=None)[source]

Bases: flask_caching.Cache

A Redis client to store responses on an external Redis server.

class Aeros.caching.CacheControl(cache_type: Aeros.caching.client.CacheTypes, max_age: int = None, immutable: bool = False, no_transform: bool = False, stale_while_revalidate: int = None, stale_if_error: bool = False, cache_on_status: list = [200])

This class manipulates the Cache-Control header in all responses sent from an endpoint decorated with this class.

Hint

If you need conditional caching rules you may still use response from quart to manipulate the Cache-Control header to your needs.

__call__(self, f: callable)callable
class Aeros.caching.CacheTypes

Bases: enum.Enum

An enum to replace the cache option strings with variables for auto-complete in most IDEs.

NO_CACHE = no-cache
NO_STORE = no-store
PUBLIC = public
PRIVATE = private