Here are some tips on how to optimize your weblog and make the page load times drop:

  • Sidebars: Sidebars are everything when you're talkin about page load. I have found that sidebars on the right decrease page load times dramatically. Having the sidebar on the right also allows the content to load first. The content is what your readers have come for and hence they can start reading even before the page has fully loaded. The default MT templates have the sidebars positioned to the right, to change your sidebar location you'll need to change the float element in the css:
float:right;

or you may have to move around some of your markup (the template code)

  • Content: Although content is good having too much of it on the front page will again increase the load time. On my weblogs I usually have about 8 entries displaying, I use the lastn element to set this rather than the setting in weblog config. You can set it as such
<MTEntries lastn="8">

Another good tool that can be used is the extended entry field when creating an entry. If you have a lengthy entry consider splitting it up, use the Entry Body and Extended Entry fields wisely.

  • Macros / Regexes: I have personally found - though many have rebuked it - that having too many macros or regexes courtesy of the Macro and Regex plugins will also increase the load time. Consider removing smilies, acronyms or any other items that you do not use often.
  • Images: Too many, large size, images will greatly increase the load time. You can use this tool to determine which images (or other content) is biggest in size and hence increasing the load time greatly. After you have found images that are biggest in size consider optimizing them. Tools such as Adobe Photoshop have built in optimizers. I would personally recommend Irfan View

  • GZip Content: With this technique, all PHP files will be compressed transparently on the server and then sent to the client. Another plus point about gzip compression is that your bandwidth will also be saved. To implement gzip compression, you need to be able to access a file on your server called .htaccess and your server will need to have PHP installed and specifically a module called ZLib (Zlib is used for the compression here). In the .htaccess file add this line:

php_value output_handler ob_gzhandler

and voila you're content is compressed you can check your savings with this tool

3 Comments

Brad Choate said:
on Aug 29, 2004 1:56 AM | Reply

No, Macros and Regex tags (and any other tags you use for static publishing) has no effect on load time. They have an effect on rebuild times in Movable Type, but not on page load time, since no MT tags remain in the published content. Just text.

Shafiq Rehman said:
on Jun 16, 2005 7:24 PM | Reply

Compressing the php files with Zlib is excellent. I reduced the bandwidth size 70%. It is marvelous tool for PHP community.

ssp said:
on Jan 4, 2006 4:45 PM | Reply

I only recently discovered the PHP/gz technique and it's pretty cool!

However, I failed to get it to work for my RSS feeds and other auxiliary files (CSS, JavaScript) which would also greatly benefit from compression.

Any hints on that?

Leave a comment

Preview