H
H
hesy2021-01-22 16:56:38
PHP
hesy, 2021-01-22 16:56:38

How to proxy/hide the original link with a token?

There is a service API link that contains an open token in the parameter, the link itself leads to an image (2-3 mb).

Naturally, it would be wrong to directly transfer the link to img src, but the display speed will be instantaneous.

I tried to take the picture on the server and give it away:

'data:image/jpg;base64,' . base64_encode(file_get_contents($link)),


But this is long, the page is not displayed until the image is loaded.

Okay, then I did it through Ajax, gave an empty page and made a request from it to get a picture (like a lazyload).
But it also turned out to be long + resource-intensive.

Therefore, the question arose, is it possible to somehow hide the link with the token behind another link in order to display the image directly in the browser?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question