缓存,PHP生成的缩略图加载缓慢 [英] Cached, PHP generated Thumbnails load slowly

查看:154
本文介绍了缓存,PHP生成的缩略图加载缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题A部分▉(获得100个赏金,被授予)
主要问题是如何使该网站的加载速度更快.首先,我们需要阅读这些瀑布.感谢大家对瀑布读数分析的建议.从这里显示的各种瀑布图可以看出,主要瓶颈是:PHP生成的缩略图. David建议从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个赏金,被授予)
现在,新的重点是解决6个jpg图像所具有的问题,这些问题造成了大部分的加载延迟.这6张图片是PHP生成的缩略图,很小,只有3〜5 kb,但是加载时非常相对较慢.注意各种图形上的"到第一个字节的时间".问题仍然没有解决,但詹姆斯得到了赏金,后者解决了RedBot 下划线:一个If-Modified-Since条件请求返回的完整内容保持不变." .

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缩略图到底在想什么?所有这些标头信息都可以将火箭送上月球并返回.非常感谢您对此瓶颈的任何建议并将其视为可能的答案,因为我已经在这个瓶颈问题上停留了七个月了.预先感谢.

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 UI,购买的菜单awm/menu.js引擎,tabs 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

分组的并行域 | http://webpagetest.org

站点Perf瀑布 | http://site-perf.com

Pingdom工具瀑布 | http://tools.pingdom.com

GTmetrix瀑布 | http://gtmetrix.com

推荐答案

首先,使用这些多个域需要几次DNS查找.您最好将其中的许多图像组合成一个sprite 而不是分发请求.

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.

第二,当我加载您的页面时,我在all.js上看到了大部分阻塞(约1.25秒).我看到这始于jQuery(旧版本).您应该在Google CDN中引用它,不仅要

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.

具体来说,可以在这些URL上引用最新的jQuery和jQuery UI库(请参见

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主题之一,则还可以

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.jstooltiplib.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.

这篇关于缓存,PHP生成的缩略图加载缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆