F
F
Fyodor2014-03-19 17:45:20
PHP
Fyodor, 2014-03-19 17:45:20

Should external images be cached when doing resize?

The question is next.
There is a database with images ( toster.ru/q/78486 asked about it in the last question) and there are links to images of hotels on a remote server.
So, there are a lot of good quality images, megabytes and more. Accordingly, in the gallery in the browser to show such without resizing - not every computer will pull normally, especially if there are 50 of them on the page (there are such hotels).
Here, in fact, I think, is it worth it to cache them with resize?
Images - about 500 thousand. Of course, it will take a lot of space. (I think over 100gb)
Resizing was done using the WideImage Class (on the GD library) it does not work so fast, but this is possible since the images are on a remote server (did not measure).
I do the actions on the VPS, respectively, there is an opportunity to install what you need, or increase the power. Actually, maybe there are faster ways? I don’t have a goal to transfer everything to myself, but otherwise the page will barely scroll, and on slow computers, it’s probably unrealistic to use it at all.
If you still store it at home, maybe do it separately somewhere? Where I rent now, the tariff with 128 GB costs 2400 per month. there, the power is higher at the tariff, but so far I'm not sure that so much will be needed.
In general, share tips and experience.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey, 2014-03-19
Protko @Fesor

Caching is definitely worth it. The same google does this in google images.

N
Nazar Mokrinsky, 2014-03-19
@nazarpc

I would cut at the first request for a picture, I would implement this on one project. When opening a picture, it is checked whether there is a local copy, if not, it is created and redirected to the local copy. Only I cached all the pictures in general, in my opinion (original + several cut different sizes).

T
Timur Sergeevich, 2014-03-19
@MyAlesya

Definitely worth caching! If the space allows you to store copies in low quality)

M
maxic, 2014-03-20
@maxic

On the experience of opencart, images are cached there when resized.
For example, there was an image with the name image.jpg when resized, it becomes image_100x100.jpg, after which the CMS checks whether there is an image with the name image.jpg and resize parameters 100x100 when it is loaded - if not, it resizes into the cache folder, and if there is a resize file in the cache folder, it simply assigns the cache name to the variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question