Reduce Page Load Speed, Increase Performance

Receive compressed pages in response from server for faster loading of the WordPress website.
	/* keep this code in main index.php wordpress root, for php based include on top of header */

	if(substr_count($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip")){
	}else{ ob_start(); }

Add code in .htaccess file
# 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
# Or, compress certain file types by extension:
<files *.html>
	SetOutputFilter DEFLATE

you can test compression at:
find this tutorial at :
Note: Some hosting servers like godaddy provide this compression service with hosting, no need to add the code manually. You can check in cpanel or can get support from your hosting service provider.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s