Take the 2-minute tour ×

I have a few sites I built for my work, nothing major, mainly just little tools which people can access and use when they're out of the office. I'm not very experienced as a developer but I like to tinker quite a lot and I was wondering if anyone had any clever little tweaks I could do to my sites to make them download faster? We have an office in south america with a poor internet connection who constantly complain my sites take too long to use. So far I have found the following site which was quite useful and the guys in the other office said they'd seen a difference in the service www.dev-explorer.com/articles/apache-optimisation

Anyone kno of any more little bits and pieces I could do?

Any help is much appreciated.

Thanks in advance


share|improve this question

4 Answers 4

Look into YSLOW and read the Yahoo Dev blog. You can do a lot by optimizing the front-end.

  • Limit the number of http requests (css, js, images)
  • Use mod_deflate in apache to gzip your content
  • Use a far-future expires header whenever possible
  • Make your HTML markup as lean as possible
share|improve this answer
...and tune your DB –  vladr Feb 28 '09 at 22:45

2 things (from YSlow) that will help are a CDN (Content Delivery Network)... and cookie-less servers for static content.

Even if you can just push your images to load off another server you'll be able to load your HTML content faster while image downloading can happen in the background from the other server(s).

Try to have these other servers (for images, CSS, and Scripts) be cookie-less if possible, its a minor saving, but it sounds like you're trying to squeeze every last drop. ;-)

and of course, cache everything except your HTML.

share|improve this answer

I'd got for yslow, as already said, and better (because is what yslow is based on) the Yahoo Exceptional Performance Team best practices

share|improve this answer

A few simple tricks:

Firstly, limit yourself to exactly one CSS and one Javascript file. No more. If you have multiple compact them into one (each). Ideally, your Javascript should also be minified. I've been using JSMin for this lately.

There are some more advanced techniques to optimize this further. You set the expires header to far in the future so the browser doesn't download it as often. To push changes you need to change the link to the css/js file though. You can do this with Apache mod_rewrite and a small PHP script.

More on this in What is an elegant way to force browsers to reload cached CSS/JS files?

You can also use the expires trick on images.

Secondly, gzip your constent. Typically all you have to do for this in PHP is start all your scripts wiht:


This turns on output buffering (good idea anyway) and if the browser says that it supports gzip encoding, your script will be gzipped before sending it to the client.

share|improve this answer

Your Answer

