C
C
Chvalov2018-01-22 16:50:31
PHP
Chvalov, 2018-01-22 16:50:31

How to store images on another server?

The online store has too many pictures, about 180 GB, on the server there is a 220 GB SDD.
There are a couple of ideas for implementation in my head:

  • Raise the sub domain img.shop.net and take all the pictures already from the subdomain
    (If I understand correctly, the search by image will lead the client to the subdomain?)
  • Raise a sub domain, and on the main site, when requesting images, proxy using Nginx

What other implementation options are there??
I am also interested in the method of uploading images to the second server:
1) place a php script on it that will receive a file or a link to the image and give it back
2) From the main site, a script that will upload via ftp

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Romanov, 2018-01-22
@Serhioromano

I usually implement using AWS S3 CDN. Convenient, good API, works fast, does not create a load on disks and the speed of the site itself.
You can raise a subdomain, but you need to read cards from another disk. If they are read from the same disk, then there is no difference whether it is the same or a subdomain.

V
Viktor Taran, 2018-01-23
@shambler81

Lord, there is a much simpler version
of nginx in any of its epistases
1. create a location with statics, as a rule, it already exists in nginx + apache mode, all that remains for you is to specify where they are stored.
2. load balance also nginx
3. do not take a second server, just buy another ssd and make a raid 10 or just a larger
one 4. jpegoptim - one line in the console and the pictures have sharply become 3 times smaller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question