3 ways to make your website load 2 times faster
How to speed up a website modifying .htaccess file
3 ways to speed up your website
Everyone love a website that loads faster, not only human being but also spiders and crawlers like google bot and bing love a website that loads in few seconds. This factor can raise your ranking and hence drive more triffic to your website.
There are plent of tools that you can use to check if your website is slow or not like: Google page speed, Pingdom, Gmetrix...
Why you should enhance your website loading time?
Your website needs to be fast enough for your visitors. While that may not be the answer you’re looking for, it’s the one that your website visitors will appreciate. By monitoring your bounce rate (in Google Analytics or comparable metric trackers) and page load time (using the Chrome extension “Page Load Time” or more extensive trackers) you can continue to enhance your website and better serve your visitors.
You have to know that very fast websites can rank higher in search engines easly.
When a website is fast or slow than others?
This may seem ambigous for many people but it is easy to understand. If you have a website you should struggle to make it load faster than other websites in you competion in order to rank higher than them in search engines.
This means that there is no exact spead a website should have to rank higher. However it has to be faster enought than its competitors.
Here is what researches say:
. if your site loads in 5 seconds, it is faster than approximately 25% of the web
. if your site loads in 2.9 seconds, it is faster than approximately 50% of the web
. if your site loads in 1.7 seconds, it is faster than approximately 75% of the web
. if your site loads in 0.8 seconds, it is faster than approximately 94% of the web
It would be better if your website loads in 0.8 seconds but it is not a mandatory to rank higher in search engines.
What to do to make your website to load 2 times faster?
There are many different ways to enhance your web page speed but the first one to start with is to configure your hosting server to use static file caching and compression power that it has.
To achieve this you can do the following:
You can configure your server manual by changing the .htaccess file(Create one if it does not exists) located in the root folder of your website and adding the following lines:
#BROWSER CACHE
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|jpg|jpeg|gif|png|pdf|woff2|woff|ttf)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 60 seconds"
ExpiresByType font/opentype "access plus 5 months"
ExpiresByType font/truetype "access plus 5 months"
ExpiresByType font/eot "access plus 5 months"
ExpiresByType font/woff "access plus 5 months"
ExpiresByType font/ttf "access plus 5 months"
ExpiresByType image/gif "access plus 5 months"
ExpiresByType image/png "access plus 5 months"
ExpiresByType image/jpeg "access plus 5 months"
ExpiresByType image/x-icon "access plus 5 months"
ExpiresByType application/pdf "access plus 5 months"
ExpiresByType application/x-javascript "access plus 5 months"
ExpiresByType application/javascript "access plus 5 months"
ExpiresByType text/plain "access plus 5 months"
ExpiresByType text/css "access plus 5 months"
ExpiresByType application/xml "access plus 20 minutes"
</IfModule>
#END OF BROWSER CACHE
#COMPRESSION
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
# Old Browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/png
AddOutputFilterByType DEFLATE image/jpeg
AddOutputFilterByType DEFLATE image/gif
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/eot
AddOutputFilterByType DEFLATE font/woff
AddOutputFilterByType DEFLATE font/truetype
AddOutputFilterByType DEFLATE font/opentype
</IfModule>
#END OF COMPRESSION
Wordpress Tips:
If you are using wordpress you can go futher and install WP Super Cache plugin. This will generate html pages that will be server every time a use requests a page insted of generating it from the db. This wi enhance the time load of your website.
Last but not least:
You can also add a cdn to cache your static files on the servers that are close to users. So when a user requests a page, it will load faster because the files are stored closer to him/her. In addition, you main server will be hit by few requests hence the server load time will be reduced. This will allow it deliver pages quickly.