最近不知道是因为学校网络的问题,还是主机速度的问题,俺这博客打开越来越慢了。
于是:
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.
