Worried about the speed of the website? You can make it fast and efficient using these steps.

Worried about the speed of the website? You can make it fast and efficient using these steps.

Getting a good looking website is actually not as difficult as getting a speedy website is. Eventually, it’s only the speed that matters to the user. However, we have listed down some of the ways that can actually boost your website speed. Performing these steps can actually make your website run faster than 50% of the websites on the internet.

First and foremost are the images that need optimisation. Image optimisation can be of 2 types :

a. Supposedly, there is an image which is taking only 200X150 dimensions but you put an image of more than 4000X3000 then it’s of no use as such high dimensions aren’t needed, as a result this slows the website drastically. You can always change or optimise it’s dimensions according to your requirement. This can be done on Adobe Photoshop or any image editing softwares. Doing this can make your website run way efficient than before.

b. The other reason is very obvious, as lesser size the page consumes the quicker it performs. There are plenty of websites who have images of right dimensions but the size of the images are way too much. The ideal size of an image should never be more than 50 KB. However, slow websites have images of more than 500 KBs or even more than a MB. Image size can also be reduced on any image editing softwares without even compromising on the quality.

The next step is to enable Browser Caching :

This can be achieved by adding the below code to your .htaccess file. You can locate your .htaccess file in the root directory of your website. It is highly recommended to take the back up of .htaccess file before making any changes to it. Any small mistake can ruin your site.

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"

Browser caching may be a problem for google indexing as google would also be getting your cached data all the time. So to prevent this, just apply the code after this code which you would find present in your .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

// Paste the code here 

# END WordPress

Paste the below code at the place said above to allow google to fetch the latest data and not the cached data.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com[NC]


The other way would be to apply Gzip File Compression :

All of us know, a compressed file gets copied way faster than a normal bunch of files. Same is applied to websites, having the website files compressed makes it a lot more faster for the server to respond and send the data. You can apply gzip file compression by adding the below code to your .htaccess file.

# BEGIN gzip file compression
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
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/x-javascript
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/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
# END gzip file compression

Leave a Reply

Your email address will not be published. Required fields are marked *