fromfast_cacheimportcache,FirestoreBackendbackend=FirestoreBackend(credential_path="path/to/your/service-account.json",# Optional if using GOOGLE_APPLICATION_CREDENTIALSnamespace="my-namespace",# Optionalcollection_name="cache_entries"# Optional)cache.init_app(app,backend)
Options
credential_path: Path to your Google Cloud service account JSON file.
If not provided, uses the GOOGLE_APPLICATION_CREDENTIALS environment variable.
namespace: Key prefix for all cache entries (default: "fastapi_cache").
collection_name: Firestore collection to use for cache entries (default: "cache_entries").