Answer the question
In order to leave comments, you need to log in
How much will this method load the server?
Various images are published on the site, or rather links to them. I ran into a number of problems, for example, when reposting to Twitter, not all pictures from third-party links are pulled up for various reasons.
I solved this problem like this:
1) I generate a link like mysite.ru?proxy=base64encodedurl
That is, I take a third-party link, encode it in base64 and substitute parameters in the address bar.
This request is processed on the server like this
header("Content-type: image");
$url = base64_decode($url);
if (getFileSize($url) > 500000) {//Если размер картинки больше 500кб, не обрабатываем
return $url;
}
$handle = fopen($url, "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
Answer the question
In order to leave comments, you need to log in
Why nginx theme?
To begin with, describe what kind of server, how many connections approximately? There is little information. And so I think that you need to constantly monitor the load, and then look.
PS
https://en.wikipedia.org/wiki/Load_testing
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question