How to Optimize a website ?
Online Optimization Tools
There are the following tools with the help of which you can determine the performance of your website, you just need to pass the url of your website to these tools and they will provide you the feedback/ performance of your site.
Steps to Optimize website
1.Compression with GZip
Compressing the content for sending greatly reduce the time needed to process each request.
How to enable the GZip in Cpanel
Open Cpanel then select optimize Website ->then select compress all content option on the next page and apply changes.
2. Minimize Redirect
URL Redirect generally used to link page to another page. Web Developer must avoid the url redirect because each redirect create an additional HTTP request and RTT (round-trip-time). The more redirection you have, the slower user will get to the destination page.
3.Reduce DNS Lookups
(Domain Name System) to resolve IP address for a given hostname or domain name and the browser cannot do anything until the process is properly completed.
4.Add Expires Headers
By using Expires headers these components become cacheable, which avoids unnecessary HTTP requests on subsequent page views.
Open .htaccess file and write the following code Add Expires Headers
# disable caching forthis directory mod_expires for this directory
Header set Expires "Thu, 15 Apr 3015 20:00:00 GMT"
5.Do not Scale Images
Use images of the exact size what you require otherwise it takes more load to resize it.
6.Minify JS and CSS
Minification removes unnecessary characters from a file to reduce its size, thereby improving load times.So you should minify the js and css file. Online website which minify the js and css
7.Use Image Optimization tools (like Smushit(http://developer.yahoo.com/yslow/smushit/
8.Configure ET Tags
Open .htaccess file and write the following code remove ET Tags
Header unset ETag
9.Use CSS Sprite
CSS Sprite technique reduce HTTP request each time a page is load by combining several (or all) images together on a single image file
Use following script in your html file.
or Use Sprite Me Software
<?php ob_flush(); ?>
it store the data in the output buffer,next time when page data is loaded from this output buffer.
Moving style sheets to the document HEAD element helps pages appear to load quicker since this allows pages to render progressively