I hope you know that slow web pages scare away visitors, while fast pages lead to higher visitor engagement, retention, and conversions. Here are some suggestions to optimize your web site to get large performance wins with the least development effort. You can use Google PageSpeed to verify that your settings are working.
“The task is to extract the maximum amount of milk with the minimum of moo. And I am afraid to say that these days all I get is moo.”
— (Terry Pratchett, Jingo)
HTTP keep-alive, also kwown as HTTP persistent connection, or HTTP connection reuse, means using a single connection to send multiple HTTP requests from the browser to the server.
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network. Text based resources like HTML, CSS and javascsript can easily be reduced in size by 30-50% by utilizing the automatic compression of web servers.
Enable Browser Caching
Complete optimized .htaccess file for your web site
#Headers <ifModule mod_headers.c> Header set Connection keep-alive </ifModule> <IfModule mod_expires.c> ExpiresActive On <FilesMatch "\.(ico|jpg|jpeg|png|gif)$"> ExpiresDefault "access plus 2 weeks" </FilesMatch> <FilesMatch "\.(js|css|swf)$"> ExpiresDefault "access plus 2 days" </FilesMatch> </IfModule> <IfModule mod_deflate.c> # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0 no-gzip # MSIE masquerades as Netscape, but it is fine # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 # the above regex won't work. You can use the following # workaround to get the desired effect: BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \\.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary </IfModule>
Thanks this helped alot
what a helpful article
Thanks for this article. I especially found enabling GZIP compression to really make a difference to my website speed. By the way, here is a tool to quickly check your if your website has keepalive enabled:http://www.giftofspeed.com/check-keep-alive/
Saved me a lot of time when I was testing the keepalive settings.