关于我

整理侧边栏,为了速度

2007年05月30日 PM 33:04 | 作者:李立律师(阿卡)

将原来的bo-blog程序改成了现在的wordpress,数据的转移确实费了点力气,中间又加杂了wordpress升级到2.2版的乱码问题,现在总算好了。估计各大搜索引擎中收录我的网站中的网页链接也至少要有一个月才能完全整理好,我只能暂时在404页面上写上提示,免得从搜索引擎过来的用户以为我的网站关了。

Sidebar Widgets也安装好了,起初用它在侧边栏放了好些东西,包括站外引用的内容。结果发现一个问题,页面加载速度太慢,特别是google的几个小玩意下载很费时间。为此我考虑了一下所谓“网站访问者的感受”,明确了几个想法:

1、来我的网站的用户大多是从搜索引擎而来直接找某些资料或文章的,侧边栏的东西应当是为主文而服务,站外引用的东西或装饰的东西并不是别人的兴趣所在,首先应当保证页面加载速度尽量快。

2、来访者寻找到站内特定内容后,或者离开,或者想进一步找相关资料。最有可能延伸想找的东西按排列顺序应当是:通过分类找其他文章 ;看看最近的其他文章;然后才可能想到看看作者的资料以及如何订阅网站内容。

3、除上述功能外,其他的内容根本没有必要放在我的侧边栏上。

于是,整理了一下侧边栏,就成了现在这个样子,刷新了一下,感觉下载速度成倍地提高。为了确认一下自我感觉是否准确,于是到了一个专门测试网页加载速度的网站,测试了一下首页,得到如下分析及建议(应当是不错了):

Analysis and Recommendations

* TOTAL_HTML - Congratulations, the total number of HTML files on this page (including the main HTML file) is 1 which most browsers can multithread. Minimizing HTTP requests is key for web site optimization.
* TOTAL_OBJECTS - Caution. You have 8 total objects on this page. Consider reducing, eliminating, and combining external objects (graphics, CSS, JavaScript) to reduce the total number of objects, and thus separate HTTP requests.
* TOTAL_IMAGES - Caution. You have a moderate amount of images on this page (5 ). Consider using fewer images on the site or try reusing the same image in multiple pages to take advantage of caching.
* TOTAL_CSS - Congratulations, the total number of external CSS files on this page is 1 . Because external CSS files must be in the HEAD of your HTML document, they must load first before any BODY content displays. Although they are cached, CSS files slow down the initial display of your page.
* TOTAL_SIZE - Caution. The total size of this page is 33809 bytes, which will load in over 8 seconds on a 56Kbps modem - or 8.34 seconds. Consider reducing total page size to less than 30K to achieve sub eight second response times on 56K connections. Be sure to provide feedback for pages over 30K by layering your design to display useful content within the first two seconds. Consider optimizing your site with Speed Up Your Site or contacting us about our optimization services.
* TOTAL_SCRIPT - Congratulations, the total number of external script files on this page is 1 . External scripts are less reliably cached than CSS files so consider combining scripts into one, or even embedding them into high-traffic pages.
* HTML_SIZE - Congratulations, the total size of this HTML file is 9602 bytes, which less than 20K. Assuming that you specify the HEIGHT and WIDTH of your images, this size allows your page to display content in well under 8 seconds, the average time users are willing to wait for a page to display without feedback.
* IMAGES_SIZE - Congratulations, the total size of all your images is 2471 bytes, which is less than 15K. Ideally each image should be less than 1160 bytes, to easily fit into one TCP-IP packet.
* SCRIPT_SIZE - Warning! The total size of external your scripts is 14527 bytes, which is over 8K. Consider optimizing your scripts for size, combining them, and using compression where appropriate for any scripts placed in the HEAD of your documents.
* CSS_SIZE - Caution. The total size of your external CSS is 7209 bytes, which is above 4080 bytes and less than 8K. For external files, try to keep them less than 1160 bytes to fit within one higher-speed TCP-IP packet (or an approximate multiple thereof). Consider optimizing your CSS and eliminating features to reduce this to a more reasonable size.
* MULTIM_SIZE - Congratulations, the total size of all your external multimedia files is 0 bytes, which is less than 4K.

评论(1 Comment)

  1. 那个测试网站地址是什么?

发表评论

*必填

*必填 (不会被公开)

欢迎使用RSS订阅全站