CloudFront Media Setup v158
Fast CloudFront setup for media caching, public CORS, near-fresh JSON, and no-cache debug paths.
= $error ? 'Error' : 'Result' ?>= $actionLabel ? ' — ' . h($actionLabel) : '' ?>
= h($error) ?>
= h(implode("\n", $log)) ?>
These are the reusable CloudFront policies the tool creates or reuses. Open any item to see what it means in plain English.
MediaCacheLong1Year
Used for image, audio, and video file patterns. This tells CloudFront to cache public media for a long time so repeat visitors are served from CloudFront instead of your origin.
Purpose: long-cache public media Typical paths: *.jpg, *.png, *.webp, *.mp4, *.mp3, *.wav, ... Result: faster media delivery and lower origin load
PublicMediaCORSFromEverywhere
Used when media or JSON must be readable by browsers, apps, canvases, players, creative tools, and JavaScript apps that people run from local files on their home PCs.
Purpose: public CORS response headers Allowed origin: * Common methods: GET, HEAD, OPTIONS Result: public media can be fetched by browser JavaScript apps, including apps opened from the local file system on people's home PCs, without hand-editing every behavior
JsonNearFresh
Used for JSON files that should update quickly while still getting some CloudFront benefit.
Purpose: short-cache JSON Typical paths: *.json Result: app data and indexes stay near-fresh without making all static media short-cache
DebugNoCache
Used for debug paths so troubleshooting does not poison public cache results.
Purpose: no-cache debug behavior Typical paths: *debug* Result: testing and diagnostics stay uncached