- Put Scripts at the Bottom
Now, I am by no means an expert in front-end optimization. I spend most of my time providing server management services for our clients, but in doing in many cases, I have found what needs to be fixed cannot be fixed from the server side of things.
If your site re-uses the same components over and over, you can set the server to cache these files. This way the site visitor is not re-downloading the same content over and over. As a result, your HTML page size can be smaller.
By caching js and css files, your server has fewer requests to handle. When web servers send out HTTP headers, they contain caching information. If the js or css files are already in the browser’s cache, then they will not be downloaded again. This reduces the requests/sec on your HTTP server.
Minifying is simply a process of removing all unnecessary characters from code. This makes for smaller files. Smaller files download faster and speed up your pages’ load time.
From the sever-side, if you assume your server has a maximum bandwidth that it can support, the smaller the files size the more files you can serve at the same time. While in practice tuning an Apache server for speed is not this simple, you still want to make files as small as possible.
While Yahoo does not comment directly on CSS, the issue is the same. You should not call the same CSS file more than once on a page. This is less of a problem but I have seen it on some sites. CSS files were renamed and people just included both to “be safe”.
From the server side, fewer includes means fewer HTTP requests to load the page. While HTTP request happen quickly, the time require for them can add up. If you want to speed up your site, you need to reduce HTTP requests to a minimum.
- Fix Slow Loading Websites – Yslow Image Tips
- Speed up Your Site – Yslow Server Tips