Лучший способ обслуживания загруженного мультимедийного контента - PullRequest
0 голосов
/ 04 мая 2018

В настоящее время я занимаюсь разработкой веб-сайта, который позволяет загружать изображения и другие файлы. На данный момент у меня есть пара сомнений.

Во-первых, где должны храниться эти файлы? Я думал о сохранении их в файловой системе.

И, во-вторых, как правильно подавать загруженные мультимедийные файлы? Если вы используете файловую систему в качестве носителя данных, следует ли использовать статические маршруты, настроенные на сервере, или есть другая лучшая альтернатива?

1 Ответ

0 голосов
/ 04 мая 2018
  • Где должны храниться файлы?

    If the numbers of files are limited and not very much, then you can store it in the filesystem. However, if the number is large, I would recommend to store it in some storage service like AWS S3. Process could be either of two that you store temporarily the uploaded file in filesystem and then upload it in S3 or direct upload to S3. Depends on the use case.

  • Какой самый правильный способ обслуживания загруженных мультимедийных файлов?

    In case you are using services like S3, you just have to set content type and expiration among other metadata while uploading and rest everything will be taken care by S3 only. In case you are storing data on filesystem, then you can use nginx/apache to serve the static assets files along with proper content type and other metadata.

...