Skip to main content

CachedFileInfo

TypeSource

CachedFileInfo(
type: "path" | "str" | "bytes",
data_size: int,
file_name: str,
content_type: str,
mime_type: str,
one_time_service: bool
)

CachedFileInfo is a TypedDict.

CachedFileInfo contains the metadata of the cached file.

Keywords

KeyworkType
Description
type"path" | "str" | "bytes"The type os this cached data.
data_sizeintThe length of the cached data, representing the number of bytes or characters. This value is acquired by preloading the file.
file_namestrThe file name. This value needs to be used when the data is prepared for streaming.
content_typestrThe content-type in the response. An optional encoding can be provided here. For an HTML page, this value should be "text/html; charset=utf-8".
mime_typestrThe mime-type of the response. Typically, it is only determined by the type of the file. For an HTML page, this value should be "text/html".
one_time_serviceboolA flag. When it is enabled, will use the on-exit mechanism to remove this cached data once it is served for once. This option is recommended if this cached item is used for one-time downloading.