<?php
header('Content-Type: image/jpeg');
$img = 'assets/images/1.jpg';
$src = imagecreatefromjpeg($img);
$srcW = imagesx($src);
$newW = 100;
$newH = 100;
$srcH = imagesy($src);
$im = imagecreatetruecolor($newW, $newH);
imagealphablending($im, false);
imagesavealpha($im, true);
imagecopyresampled($im, $src, 0, 0, 0, 0, $newW, $newH, $srcW, $srcH);
imagejpeg($im);
imagedestroy($im);
在HTML文件中使用类似<img src="image.php">
的缩略图制作缩略图的粗略代码是否可以将其存储到缓存中?