Skip to main content

Module cache

Module cache 

Source
Expand description

Modal image cache management.

This module provides functionality to cache Modal image IDs to avoid rebuilding images that haven’t changed. The cache is stored in {working_dir}/.offload/modal_images.json.

§Cache Structure

The cache maps cache keys (like “default”, “rust”, or “dockerfile:/path/to/Dockerfile”) to image metadata including the Modal image ID and optional dockerfile hash.

Structs§

ImageCache
Cache for Modal image IDs.
ImageCacheEntry
A cache entry for a Modal image.

Functions§

compute_file_hash
Computes the SHA256 hash of a file.