缓存,PHP生成缩略图加载速度慢:如何找到从瀑布图问题/解决方案?缓存、速度慢、瀑布、缩略图

2023-09-02 00:23:51 作者:北辰

问A部分▉(100 bountys,授予) 主要问题是如何使这个网站,加载速度更快。首先,我们需要阅读这些瀑布。感谢所有在瀑布读数分析你的建议。从这里显示的各种瀑布图明显是主要的瓶颈:在PHP生成缩略图。从CDN协议少的jQuery加载由大卫建议得到了我的恩惠,虽然让我的网站只有3%的速度总体而言,虽然不回答该网站的主要瓶颈。时间澄清我的问题,而且,另一个赏金:

Question Part A ▉ (100 bountys, awarded) Main question was how to make this site, load faster. First we needed to read these waterfalls. Thanks all for your suggestions on the waterfall readout analysis. Evident from the various waterfall graphs shown here is the main bottleneck: the PHP-generated thumbnails. The protocol-less jquery loading from CDN advised by David got my bounty, albeit making my site only 3% faster overall, and while not answering the site's main bottleneck. Time for for clarification of my question, and, another bounty:

问B部分▉(100 bountys,授予) 新的焦点现在要解决的6 JPG图像有,这是造成大多数放入延迟的问题。这6个图像是PHP生成缩略图,很小,只有3〜5 KB,但加载相对的非常的缓慢。请注意的的时间第一个字节的的各种图表。这个问题得不到解决,而是一个赏金去了詹姆斯,谁定的标题错误RedBot 强调: 一个If-Modified-由于条件请求返回的全部内容不变。的。

Question Part B ▉ (100 bountys, awarded) The new focus was now to solve the problem that the 6 jpg images had, which are causing the most of the loading-delay. These 6 images are PHP-generated thumbnails, tiny and only 3~5 kb, but loading relatively very slowly. Notice the "time to first byte" on the various graphs. The problem remained unsolved, but a bounty went to James, who fixed the header error that RedBot underlined: "An If-Modified-Since conditional request returned the full content unchanged.".

问C部分▉(我最后的赏金:250分) 不幸的是,即使经过头REdbot.org错误固定,造成PHP生成的图像的延迟仍然不变。究竟是这些微小的微不足道的3〜为5Kb缩略图在想什么?所有这些报头信息可以发送火箭地球与月球之间。在这个瓶颈任何建议是pciated并视为可能的答案多少AP $ P $,因为我停留在这个bottleneckish问题已经7个月了。我在此先感谢。

Question Part C ▉ (my last bounty: 250 points) Unfortunately, after even REdbot.org header error was fixed, the delay caused by the PHP-generated images remained untouched. What on earth are these tiny puny 3~5Kb thumbnails thinking? All that header information can send a rocket to moon and back. Any suggestions on this bottleneck is much appreciated and treated as possible answer, since I am stuck at this bottleneckish problem for already seven months now. My thanks in advance.

[我网站上的一些背景信息:CSS是在顶部。 JS底部(jQuery的,JQuery用户界面,买菜单AWM / menu.js档案引擎,标签JS引擎,视频swfobject.js)黑线的第二个形象展示什么引发什么加载。愤怒的机器人是我的宠物ZAM。他是无害的,往往更快乐。]

[Some background info on my site: CSS is at the top. JS at the bottom (Jquery,JQuery UI, bought menu awm/menu.js engines, tabs js engine, video swfobject.js) The black lines on the second image show whats initiating what to load. The angry robot is my pet "ZAM". He is harmless and often happier.]

负载瀑布:年代 | http://webpagetest.org

Load Waterfall: Chronological | http://webpagetest.org

平行分组域 | http://webpagetest.org

Parallel Domains Grouped | http://webpagetest.org

网站-PERF瀑布 | http://site-perf.com

Site-Perf Waterfall | http://site-perf.com

Pingdom的工具瀑布 | http://tool​​s.pingdom.com

GTmetrix瀑布 | http://gtmetrix.com

推荐答案

首先,使用这些多个域需要多个DNS查找。你会更好结合许多这些图像变成一个精灵,而不是 US preading的要求。

First, using those multiple domains requires several DNS lookups. You'd be better off combining many of those images into a sprite instead of spreading the requests.

第二,当我打开你的网页,我看到的大部分阻塞(约1.25秒)的all.js.我看到开头(旧版本)的jQuery。您应该参考来自谷歌的CDN,不仅decrease加载时间,但potentially避免HTTP请求它的全部。

Second, when I load your page, I see most of the blocking (~1.25s) on all.js. I see that begins with (an old version of) jQuery. You should reference that from the Google CDN, to not only decrease load time, but potentially avoid an HTTP request for it entirely.

具体而言,最新的jQuery和jQuery UI库,可在这些URL引用(见的这个帖子如果你有兴趣,为什么我省略了 HTTP:):

Specifically, the most current jQuery and jQuery UI libraries can be referenced at these URLs (see this post if you're interested why I omitted the http:):

//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js

//ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js

如果您使用的是默认的jQuery UI的主题之一,​​你也可以的拉它的CSS和图像关闭谷歌CDN 。

If you're using one of the default jQuery UI themes, you can also pull its CSS and images off the Google CDN.

使用jQuery的托管优化,还应结合 awmlib2.js tooltiplib.js 成一个文件

With the jQuery hosting optimized, you should also combine awmlib2.js and tooltiplib.js into a single file.

如果你处理这些事情,你应该会看到一个显著的改善。

If you address those things, you should see a significant improvement.