Best way to cache resized images using PHP and MySQL

前端 未结 9 1548
庸人自扰
庸人自扰 2020-12-22 23:54

What would be the best practice way to handle the caching of images using PHP.

The filename is currently stored in a MySQL database which is renamed to a GUID on upl

9条回答
  •  攒了一身酷
    2020-12-23 00:41

    There is two typos in Dan Udey's rewrite example (and I can't comment on it), it should rather be :

    RewriteCond %{REQUEST_URI} ^/images/cached/
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule (.*) /images/generate.php?$1 [L]
    

    Regards.

提交回复
热议问题