1. Use a CDN
A content delivery network or content distribution network (CDN) is a very effective way to speed up your site, and content deployed in multiple data centers across the Internet. A CDN replicates your content on servers around the world; each visitor receives that content from their closest server, making page loading times much faster.
2. Leverage browser caching
To cache static contents add the following lines on your .htaccess file.
# BEGIN EXPIRES
ExpiresDefault “access plus 10 days”
ExpiresByType text/css “access plus 1 week”
ExpiresByType text/plain “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType application/x-icon “access plus 1 year”
# END EXPIRES
3. Enable gzip compression
Gzip compression is effective way to save bandwidth and speed up your website. When a user hits your website a call is made to your server to deliver the requested files.
The bigger these files are the longer it’s going to take for them to get to your browser and appear on the screen. The Gzip Compression of your HTML and CSS files with gzip typically saves around fifty to seventy percent of the file size. This means that it takes less time to load your pages, and less bandwidth is used over all.
For apache serverto enable compression in add the following to your .htaccess file:
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0 no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
Verify Your Compression
Once you’ve configured your server, check to make sure you’re actually serving up compressed content.
Use the blow link to check whether your page is compressed.
4. Enable Keep-Alive
Keep-alive is a bit of communication between the web server and the web browser.
HTTP is a session less protocol. A connection is made to transfer a single file and closed once the transfer is complete. This keeps things simple but it’s not very efficient.Web Development India
To improve efficiency something called KeepAlive was introduced. With KeepAlive the web browser and the web server agree to reuse the same connection to transfer multiple files.
sudo vim /etc/httpd/conf/httpd.conf
And uncomment the blow line.
Now you need to restart your httpd service.
sudo service httpd restart
KeepAlive enabled on your server.
5. Optimize images
With images, you need to focus on three things: size, format and the src attribute.
I) Image size
Oversized images take longer to load, so it’s important that you keep your images as small as possible. Use image editing tools to:
Crop your images to the correct size. For instance, if your page is 570px wide, resize the image to that width. Don’t just upload a 2000px-wide image and set the width parameter (width=”570”). This slows your page load time and creates a bad user experience.
Reduce color depth to the lowest acceptable level.
Remove image comments.
II) Image format
JPEG is your best option.
PNG is also good, though older browsers may not fully support it.
GIFs should only be used for small or simple graphics (less than 10×10 pixels, or a color palette of 3 or fewer colors) and for animated images.
Do not use BMPs or TIFFs.
For more information, please contact us with the specifications for your project. You can email our sales team at firstname.lastname@example.org, also you can call us at following numbers.
India: (+91) 44 42170775, (+91) 91766 40375
USA [Toll Free]: 866 220 6565