PHP ile önbelleğe alma oluşturulan görüntüler

0 Cevap php

I am trying to cache images which have been generated. You create a image by accessing the file by resize.php?width=x&height=y. If the image of that width and height does not exist I use imagemagick to create it. However if it does exist it is served to the visitor.

! File_exists ($ isim) onay çalışıyor öylesine onun değil gerektiğinde işlem yapılmaz. Ancak görüntüler hala yüklemek için bir süre alabilir.

Readfile benim yaklaşım yanlış ya da ben yanlış başlıklar kurdunuz?

if (!file_exists($name)) {
 //image processing here
}
header("Content-Type: image/png");
header("Expires: Sat, 25 Jul 2020 10:00:00 GMT");
readfile($name);

Teşekkürler.

0 Cevap