最近不知道是因为学校网络的问题,还是主机速度的问题,俺这博客打开越来越慢了。
于是:
1.我删掉了多数统计组件。
包括CNZZ、Clicki、收录查询等等。装上了本地的FireStats取而代之。只是FireStats无法统计访客的来路域名,这让我很纠结,也很怀念Click。或许我应该做一个测试,在图片大小已经优化了之后,或许可以承受Clicki的拖累了。
2.我把页面的主题图换成了GIF格式。
这让我的主题图片由过去的50KB,减到了现在的16.7KB。
3.我把WP的头像功能关闭了。
这样就免去了下载头像图片的时间~呵呵~
现在我还在继续发掘网站增速的方式,或许“通过修改主题来减少数据库的访问查询次数”是其中的一种可取的方法。
如果你有什么好的建议,欢迎给我留言,呵呵~
另外,谷歌到一篇攻略,特与你来分享。
Your website is too slow ? Try these tips to improve your website speed:
1.Remove everything unnecessary
This tip may sound dumb, but please look at your website once again: do you really need this background sound (most people find them annoying anyways). Is that huge GIF animation with jumping bunny really that cool ? And do you really need this crappy JavaScript code for the flying clock ? Remember, all this stuff needs time and bandwidth to be loaded with every page view and don’t forget the most important thing: People are visiting your website to get information – just give them what they want !
2.Avoid nested tables
Don’t place tables inside another tables – the browsers need much longer to parse this.
3.Use CSS where possible
By using a linked Cascading Style Sheet, which is basically just a set of instructions of how to represent elements your source code will be a lot lighter, therefore load faster.
There are many good internet sources where you can learn some CSS basics. Invest some time in it – it’s worth it !
4.Optimize your images !
Images are the most heavy part of many websites. Try to reduce the amount of images as much as you can. Remove all the fancy GIF animations and replace them with static images.
Always define the width and height of an image by setting the image tag attributes. That way, the browser will already know how the things will look like and will load the rest of the page. Otherwise, it loads the image first and then the rest of the page.
Consider using smaller clickable thumbnails instead of big images where possible.
Reduce the filesize of your images – there are a lot of free tools out there. For example, GIFCruncher for GIFs and JPEG Wizard for JPEGs.
Use GIFs instead of JPEGs. JPEGS are only good for fine images like photos, for all other web graphics GIF is usually a better choice.
5.Clean up your code
Many WYSIWYG HTML editors leave a lot of unnecessary code like empty tags (like ) and comments in your source code. remove them with a simple text editor for a faster website loading.
6.Remove whitespaces
Every unnecessary space between your tags and new line characters are increasing your page size.
gif的话速度会快?
[回复]
llision 回复:
三月 30th, 2010 at 21:37
你个猪头啊~我文章里说了嘛~
图片格式的变化让图片变小了嘛~
图片小了,速度就快了呗,嘿嘿~
[回复]
濯焰鸟 回复:
四月 4th, 2010 at 23:19
一般图片转成gif后会小一些,下载速度当然会快了
[回复]
路过留下脚印
[回复]
llision 回复:
四月 2nd, 2010 at 13:07
哈哈~谢啦~
[回复]
还可以看看代码是否可以精简?繁冗的代码页会降低速度的
[回复]
llision 回复:
四月 8th, 2010 at 12:21
嗯~最近太忙,一直没来折腾,呵呵~
[回复]
现在速度很快了,比我公司的网站快多了
[回复]
llision 回复:
四月 8th, 2010 at 12:21
啊……呵呵……大家都是被网速拖累的人啊~
[回复]
感觉不快
[回复]
llision 回复:
四月 8th, 2010 at 12:22
我也这么觉得,但是越这么觉得越发现问题不在代码上。学校用网的高峰段,我的博客经常打不开……囧……
[回复]
速度的确很快的
[回复]
llision 回复:
四月 12th, 2010 at 00:43
呵呵,谢谢~
[回复]
嗯。算是一些小技巧吧。学习了
[回复]
网速网速。。现在的的人对网速的要求越来越高了。。
[回复]