get_use_cdn

get_use_cdn()

Return the current default for use_cdn.

Reads MAIDR_USE_CDN from the environment on first call so that MAIDR_USE_CDN=auto python ... works without requiring callers to invoke :func:set_use_cdn themselves.

Notes

The built-in default is "auto" — this mode emits a CDN <script> with a client-side onerror handler that falls back to the bundled copy on network failure. The browser remains the authoritative signal for CDN reachability; Python never probes that.

Python does make one network request on the CDN paths (True and "auto"): resolving the published maidr version so the emitted URL is immutable instead of the mutable @latest dist-tag, which browsers cache for a week. It runs once per process, is bounded by MAIDR_CDN_TIMEOUT (3s total), and falls back to @latest on failure. Set MAIDR_CDN_VERSION=latest to skip it entirely. use_cdn=False never makes any request.

With one exception, which this setting cannot reach: the Altair adapter always loads from the CDN and always resolves, because use_cdn is not plumbed through it. So an Altair chart can still spend the lookup budget under MAIDR_USE_CDN=false. MAIDR_CDN_VERSION=bundled is the setting that stops it, and :func:save_html / :func:show say the same.