Media is best served via optimised CDN service, this method also supports rapid development processes. Here's why.
Media assets in Magento
Many merchants don't take advantage of the benefits in using alternative domains for media assets. There are many, not least the potential distribution of assets via a CDN and/or image optimisation service, but also for development. If you do not declare Media URLs in your Magento store then spinning up a local instance (or using MDOQ) will yield broken images everywhere.
Referencing Media within CMS
Always use the media url
declaration in your blocks and pages. so inside your src
use {{media url="wysiwyg/filename.jpg"}}
and not /media/wysiwyg/filename.jpg
.
Some versions of Magento 2 might encode the quote marks when using the WYSIWYG 'Insert Image' function. Always check this and if required correct by hand.