page:guides:flask:cdn assets

Deliver public assets through CDN for Flask

Summary

Cdn assets for a Flask app on Ample. Verified on Flask: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: pip install into .ample/python from requirements.txt, then waitress from app.py reading PORT on the python-3.12 template.

Prerequisites

Workload

Deliver public assets through CDN.

Framework

Flask

Tested Configuration

Workflow Steps

  1. Build and start
    pip install into .ample/python from requirements.txt, then waitress from app.py reading PORT on the python-3.12 template; the server must bind 0.0.0.0 on PORT.
  2. Publish a bucket for public assets
    Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.
    ample bucket publish
  3. Verify
    Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.
    ample logs --kind build

Limitations

Cost Estimate

Evidence Summary

Examples

Success Checks

  1. Description: app responds on its public URL
    Kind: http_get
    Path: /
    Expect: ample canary flask patterns
  2. Description: versioned-static-assets check from the example
    Kind: http_get
    Path: /p/versioned-static-assets
    Expect: see the pattern fixture checks

Next Actions