Deliver collectstatic assets at the edge
Fingerprinted static files can stay cached when collectstatic publishes a new version.
Point a CDN hostname at the output of collectstatic. Treat public media uploads separately from private files that require an application permission check.
Point STATIC_URL and MEDIA_URL at Cloud CDN. Cache anonymous pages where safe. Bypass admin, authenticated views and POST.
Fingerprinted static files can stay cached when collectstatic publishes a new version.
Uploads are cached and can be resized at delivery time.
django-admin and session views are not cached.
After collectstatic lands on an origin Cloud CDN can pull.
Map MEDIA_URL for publicly readable uploads.
Marketing or docs views can be cached with purge.
Never cache POST or authenticated HTML.
WhiteNoise can still serve as origin. Cloud CDN caches that result worldwide and offloads the app cluster.
Keep hashed filenames. Long-cache those files and purge unhashed HTML on deploy.
Public, identical GET responses can be cached. Authenticated APIs must bypass cache.
Use the storage hostname as origin or sit Cloud CDN in front of it for the public URL.