Statistics show that you only have about 3 seconds to capture the attention of your website visitors before they get bored and go somewhere else. You have a lot to do within those first 3 seconds, and you don’t want to waste it all on having to wait for your page to load. I’ve received a few emails from people telling me that they’ve done all they could think of, but their site still takes too long to load and they wanted to know what some of the methods were that I implemented in order to get JWRmeda to load so quickly.
When my blog first went online, I wanted to optimize it for speed and for the search engines as much as possible. I ran speed tests during each stage of the optimization process to record the effects it had on my site. Here’s what I came up with:
NOTE: To test my page load time, simply inserted the following code somewhere on my page:
Load time: < ?php timer_stop(1); ?>
The average page load time before I did any optimization was 2.138 seconds.
1. Cache objects
The first time a person visits your site, the page requested may have to make many HTTP requests for stylesheets, javascript, images, flash, etc. By instructing your site to cache certain objects, a browser will only have to load these objects once. Subsequent page views by the same visitor will require much less requests, thus significantly reducing your page load time.
Here’s what I inserted in my .htaccess file:
<filesmatch “\.(jpg|jpeg|png|gif|css|js|swf)$”>
Header set Cache-Control “max-age=604800, public”
</filesmatch>
The above code will cache all jpg, jpeg, png, gif, css, js and swf files for 1 week. For more information on enabling caching with .htaccess, see cache filetypes.
After making this optimization, my average page load time took 1.447 seconds.
2. Merge all stylesheets & javascript
It’s a proven fact that a browser will load one large stylesheet much faster than multiple smaller stylesheets. The same goes for javascript files. I took all the stylesheets from my theme, Wordpress and all of the plugins I’m using and squished them all into one larger stylesheet. I did the same with my javascript files. I do have a few .css and .js files I’ve kept separate that only have components that are needed on a few pages of this site, so they only load when needed.
After making this optimization, my average page load time took 1.034 seconds.
3. Cut down your page content
Many people who own blogs will display up to 10 posts on the same page. This is a lot of content to load. Instead, try cutting it down to 5 or 4. Chances are nobody is going to sift through 10 of your most recent posts anyway, and now your pages will load faster.
I was never using more than 4 posts per page, so I don’t have a new page load time to share with you.
4. Compress images
Image compression is a HUGE factor for Continue Reading
Popularity: 3% [?]