Easy tweaks to speed up your blog with htaccess

Today am go gonna let you know few trick about .htacess which can speed up your blog or website and it will also improve your SEO. If you are using VPS for your particular blog then that will be rock after these tweaks with your apache server.

How to create a .htaccess file?

I have seen that many people on the internet asking about this but seriously its damn easy because it’s a normal text file start with dot :D. Well you all need to do Open note pad and put commands on it save it named as .htaccess, but always make sure you select All Files in Save as type while saving.

Enable GZIP compression: You could compress about 60% file size, suppose your home page size is about 100KB then GZIP will convert it to about 30KB as result your blog will load 3 times faster than before.

Add this code in your .htaccess file to enable for your blog

“# compress text, html, javascript, css, xml:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript”


Enable Page Cache: Whenever any of your visitor load your website or blog that time browser download all basic files of your website in his computer. And if you visitor return to your website again browser will load files of your website from his own computer’s cache instead of re-downloading from your web hosting server.

In this case you can define time of your website cache by adding bellow code in your .htaccess file..

<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A300

# Expires after 1 month
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType application/pdf A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/plain A2592000

# Expires after 1 day
ExpiresByType text/css A86400

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Comment