使用智能图像调整器调整多个图像大小的性能较差

发布于 2024-09-28 23:00:48 字数 471 浏览 0 评论 0原文

我正在使用 智能图像调整器 动态调整图像大小,它效果很好 - 对于图像很少的页面。

然而,当加载包含 72 个图像的页面时,需要 6-7 加载秒数(在本地主机上)。 如果我只是输出文件名(不使用 image.php),页面就会加载 一秒钟之内。

这就是我所做的:
1. 循环遍历包含 18 个画廊的数组(文件夹路径)
2.读取每个文件夹中的前4张图像
3.使用image.php输出图像

我希望页面第一次加载时会很慢,因为 它需要生成存储在 /imagecache/ 文件夹中的新图像。

但看起来它会为每个页面加载处理所有文件, 然后将其与缓存文件进行比较,看看是否有 变化(?)。

有什么办法可以加快这个过程吗?

I'm using Smart Image Resizer to resize images on the fly and it works great - for pages with few images.

However, when loading a page containing 72 images, it takes 6-7
seconds to load (on localhost).
If I just output the filenames, (not using image.php), the page loads
within a second.

This is what I do:
1. Loop through an array containing 18 galleries (path to folder)
2. Read the first 4 images from each folder
3. Output image using image.php

I would expect the page to be slow the first time it's loaded, because
it needs to generate the new images that are stored in the /imagecache/ folder.

But it looks like it's crunching all the files for every page load,
and THEN compares it to the cached files to see if there are any
changes(?).

Is there any way to speed up this process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文