Media file caching
Typically, the bulk of a page web's transfer load is accounted for its media files, most of which will be images in the page.
All media files are handled by our dedicated storage and hosting providers. These are Amazon Web Services’s S3 service, or a generic S3 hosting service via another provider. Currently, most projects use Amazon’s own S3 service, with the exception of projects in our Swiss region.
See the Divio Cloud Developer Handbook for more information about this:
- Working with your project’s media storage in Python applications
- How to interact with your project’s media storage
Delivery of these files is handled by the Cloudflare Content Delivery Network, which also caches the files.
Basic media file caching behaviour
- Caching is provided on all projects and plans, and on Test as well as Live servers. It's automatic and requires no additional action or configuration.
- Each file is cached indefinitely; the cache is not invalidated automatically when the file is changed, unless its URL is changed.
- Caching is URL-based, and wholly content-unaware - the caching system does not detect when files have changed.
However, other options for caching are available on request, and caches can be invalidated on request by our infrastructure team.
Applications in your projects may make use of Django's own caching framework. This behaviour can be configured in your project code.