I just created a new website for Worksheets site. I am in the process of moving all the worksheet’s I created for another site over there but I have to regenerate every worksheet with a new copyright. So far I have just have some Math Worksheets posted but will soon have the rest posted. It’s a very similar design to my others because I obviously am not very creative but it’s simple and functional…not to mention fast.
Security Now!
I’ve become obsessive compulsive about my website optimization but it’s one habit I don’t feel so bad about. You’ll notice this site loads fairly quickly and yet there is still a lot I didn’t do. But let me start by explaining what I did to increase the speed.
Reduce HTTP Requests
Every HTTP request your browser makes for an image, css, javascrip or other files it takes time. By reducing the number of HTTP requests you can make a huge difference on load times. Using thing like CSS sprites and reducing the amount of images you use can dramatically improve speed.
Validate
This shouldn’t have to be said but too many sites have error which cause the page to render incorrectly or they use meaningless markup which just adds weight to the page which causes longer download times. Occasionally the site doesn’t validate because something I have in one post conflicts with another post but the code in the template and each individual post contains only valid HTML or XHTML. When I have extra time I go back and try to fix the errors that do appear.
Missing Favicon
I know this is minor (did I mention I’ve become obsessive compulsive?) but I was getting a lot of 404 error because I didn’t have a favicon but browsers were looking for it anyways. Just download this blank favicon HERE and put it in the root of your site.
Gzip
This is where we start to see some real work being done. Servers have the ability to compress certain types of content before it send it to the browser and the browser then uncompresses it before render the page. This all happens in milliseconds and makes a dramatic change in the sites performance. This is what I’m using in my .htaccess file.
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
ExpiresDefault A2592000
Header append Cache-Control “public”
Header unset Last-Modified
Header unset ETag
FileETag None
Header set Expires “Sat, 4 Jul 2009 20:00:00 GMT
Remove White Space From Javascript and CSS files
Did I mention I’ve become obsessive compulsive about this? There are some PHP scripts that will remove the white space from javascript files for you. The one I used is JSMin.
Avoid Javascript
I don’t use javascript except for Google Analytics or the bookmarking toolbar on each post. By removing some common javascript frameworks that many sites use, I was able to decrease load times on the client side by .6-1.2 seconds.
Use Multiple Domains
Browsers are capable of downloading a certain number of items from a single host at any given point in time. Browsers will see domain.com and sub.domain.com as two different hosts and will download more components at one time. But don’t use too many hosts at one time or it won’t make any difference because you’ll be adding more time for each DNS lookup.
