Use a media database
By default, all images, compiled CSS files, and compiled JavaScript files of the Commerce instance are stored in the file system on the web server. You can choose to store these files in a database on a database server. One advantage of this approach is the option of automatic synchronization and reverse synchronization between the web server file system and the database. You can use the default database to store media or create one. To be able to use a newly created database as media storage, you must add information about it and its access credentials to the env.php
file.
Database workflow
-
Browser requests media - A page from the store opens in the customer鈥檚 browser, and the browser requests the media that is specified in the HTML.
-
System looks for media in file system - The system searches for the media in the file sy