To make your site even faster, serve certain content from different subdomains. For instance, on this site I serve (html, favicon, etc.) from
www.askapache.com, (css, js, images, uploads, etc.) from static.askapache.com, and (flash, flv, swf, movies, mp3, etc.) from f.askapache.com. The reason this works is amazingly cool!Easy Apache Speed Tips Articles
- Turn On Compression
- Add Future Expires Header
- Add Cache-Control Headers
- Turn Off ETags
- Remove Last-Modified Header
- Use Multiple SubDomains
A subdomain is the part of a domain that is appended to the beginning of the domain name, like a prefix. For example, my domain is “
askapache.com,“ and 3 subdomains I am using are ”www.askapache.com,“ ”static.askapache.com,“ and ”f.askapache.com”.Some handy in-page links to help you navigate:
- ≈ Speed Benefits of Multiple Subdomains
- ≈ Start using Subdomains
Speed Benefits of Multiple Subdomains
Basically when a visitor comes to http://www.askapache.com/htaccess/htaccess.html, they make a DNS request for each of my 3 subdomains [www/z/f].askapache.com to translate them into IP addresses. These hostname to IP address translations are then cached for that visitor, so no more DNS requests are needed. Because the first request was for http://www.askapache.com/htaccess/htaccess.html, the browser requests the .html document from the www server first. In the .html document the browser is told to also retrieve .css and .js files from my z server. In the .js file I load some flash which tells the browser to fetch the flash from my f server. So the users are able to see the content (.html) first, but thats not the only benefit to using these subdomains.
No comments:
Post a Comment