V
V
Vladimir Yegudin2019-11-19 12:23:57
HTML
Vladimir Yegudin, 2019-11-19 12:23:57

Why does the image in Viber appear only the second time?

Maybe someone faced a similar problem, I can not understand what's wrong.
The site has OpenGraph tags for each product. At the same time, the mechanics of working with images on the server is implemented as follows:
- if there is a jpg file at the requested link, then Nginx simply gives it to the client
- if the requested file does not exist, then Nginx calls Apache, which in turn launches PHP, which creates the requested image and passing the headers gives the received image
I give the headers like this: the pattern of accessing images is something like this: - the first time - the time is long (500-600 ms) - since the server generated the image,
header("Content-type: image/jpg");
5dd3b2f93b128622853516.jpeg
- the second and subsequent times - the time is less ( 100-200
ms ) - since this is only its loading (the browser cache was cleared before each request) If the image is on the server, that is, it has already been generated, then the link is sent with the image.
Why does this happen - 500-600 ms is too long for a viber, do I need to take a more powerful server, or what could be the matter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Egudin, 2019-11-19
@vivaldy

I conducted an experiment on another site with the same settings, that is, the image is formed according to the same principle.
The time is similar to the one in the first case.
However, everything works fine on this site. I tried to delete and send - there is always a photo. Maybe it's microdata? Or what else could it be?
The answer was found - it's in the comments

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question