Bandwidth: This section details the data transferred for videos served directly via MP4. You can check the top assets by traffic, as well as the top referrers for assets, while the graph highlights in purple all the traffic generated by your projects' assets.
If you notice a spike in your overages and usage metrics, it’s essential to investigate and address the root cause. A common issue is high bandwidth usage due to serving MP4 videos directly. To troubleshoot this:
Audit your site for <video>
tags and switch them to HLS streaming if they are currently set to serve MP4 files directly.
Use the network tab in your browser’s developer tools to ensure videos are being served from stream.mux.com
and not datocms-assets.com
Here are some suggestions for optimizing the scenario where you want to use a looping video as a background in your page layout:
Use Short Clips: Keep the video short enough to fit within the browser’s memory cache (typically less than 10 seconds). This prevents Mux from re-downloading the video each time it loops, reducing streaming costs.
Optimize Quality and Size: Balance video quality with file size to minimize data usage without sacrificing user experience. In some cases, using a lower resolution MP4 might be more cost-effective than HLS streaming if the browser can reliably cache it.
Alternative Hosting: Consider hosting the video on a third-party CDN if their bandwidth costs are lower. This approach can bypass both Mux and DatoCMS CDNs, potentially reducing expenses further, especially if you have a preexisting contract with them that includes high amounts of bandwidth. You would be billed separately by the third-party host.
Static Asset on Your Frontend: If your file is small enough and you have a sufficient plan with your frontend's current host & CDN, consider adding the file to your frontend repo and serving directly from there, alongside your favicons, decorative images, fonts, etc. This is similar to the previous option of hosting the video on an alternative host, but this saves you the trouble of needing a seperate account & plan just for hosting these videos. Please check with your frontend host to see how this would affect your billing.