The server is an intranet, maps an external network address, and has a web program that displays pictures of other servers on the intranet. The current approach is to use PHP's file_get_contents method to download the image, and then use nginx to proxy the external IP address to the PHP program, so that the image can be accessed. The amount of pictures every day is about 6 million, and after the front-end page is opened, a large number of pictures are not fully displayed. The previous method was to download all the images to the local server, but the disk pressure was very high and the images needed to be deleted every day. Please tell me, Dashenmen, is there a good way to transfer this image?
Qiniu mirror mode, when you visit Qiniu for the first time, Qiniu has no pictures. At this time, Qiniu will return to the source site to grab pictures. The source site will use your original strategy when the first picture is accessed. Once there is an image on your local server, it means that the image has been cached by Qiniu, that is, the image can be deleted.
Specific setting steps:
1.Set Qiniu mirror mode to your site
2. Keep your downloaded image resources to your local policy implementation
3. Set up a scheduled script on the local server to clean up the images of the file mtime one hour ago
4.Set the url domain name of your site image to Qiniu image domain name
nginx reverse proxy image server.
Save all the pictures on one disk (or multiple disks), and then mount this disk on each server, that’s it
As mentioned above, nginx reverse proxy can also be used