Tutorial

Maybe you have read the Boonex suggestions for speeding up dolphin and/or hosting server setup recommendations for optimal dolphin 7 performance.

@ Boonex:
Speed improvements for Dolphin

@ Boonex:
Hosting Server Setup Recommendations for Optimal Dolphin 7 Performance

@ Dialme:
How To Speed Up Dolphin

I have found them helpful or useful to some extent.


I have been able to add compression to Dolphin 7 which reduces page size and increases the speed at which they load even more.

I accomplished this by turning on and setting zlib.output_compression on my setup.

There are a couple of ways of doing this depending on your hosts setup or configuration. They obviously need to have zlib.output_compression available on the server. You will also need to know if your host has mod_php, suphp, fast-cgi, etc. Which will determine whether you would use .htaccess or php.ini.

To check see if your host has zlib.output_compression available simply login to your Dolphin 7 Administration. Then, navigate to:
Tools
-Host Tools
--Phpinfo

Dolphin 7 Host Tools



Then scroll down the page until you find the zlib area. If you find zlib you should see something like:
ZLib Support enabled

Which means it is installed and available on the server.

Then in the second part in the Directives you might see something like:
zlib.output_compression Off
zlib.output_compression_level -1
zlib.output_handler no value

Those are the default values. By default zlib compression is off and -1, which basically means no compression. It is available, but no compression by default. If you do not see or can't find zlib, then possibly your host has disabled or removed it completely.

Zlib Compression Off



At least we know it is available at this point.

For mod_php (apache dso handler) you will need to use .htaccess

For suphp and fast-cgi you will need to use php.ini

Note:
All hosting server setups vary. You maybe allowed to override your hosts configuration with .htaccess or php.ini and you may not.

For fast-cgi you might only need 1 php.ini file in your main directory. (yoursite.com/php.ini). This could vary and you may need to ask your host for certain.

Suphp usually needs a php.ini file in more than 1 directory or folder. Any and all directories or folders you wish to make a change to could require a php.ini file. Again you may need to ask your host for certain if you do not know.

For more reading and information about suphp and examples see:
Dolphin 7 Fatal Error Out of Memory

How to determine if your host uses mod_php / apache handler / DSO, cgi (suphp), or fast-cgi refer to this tutorial that can help you figure this out:
.htaccess & php.ini Help Guide


Note:
Server API - Apache = .htaccess (to make changes)
Server API - CGI or Fast-Cgi = php.ini (to make changes)



#Suphp
For suphp setups or configurations you can enable and test this for the Dolphin 7 Administration area by creating a php.ini file with the following:

zlib.output_compression = on
zlib.output_compression_level = 1
zlib.output_handler = zlib.output_compression

Name and save it as php.ini and upload it to yoursite.com/administration/php.ini or wherever the full path to your Dolphin 7 Administration directory or folder is located.

After you have uploaded it, refresh the phpinfo page again and find the zlib area.
Tools
-Host Tools
--Phpinfo

If the changes work you should now see:

Zlib Compression On



Notice the Directives now:
zlib.output_compression On
zlib.output_compression_level 1
zlib.output_handler zlib.output_compression

Which means compression is now on with a level of 1. You really don't want to increase the zlib.output_compression_level any higher than 1. Doing so can put additional strain on the server. Level 1 compression is more than enough. You will get very little additional compression if you increase the number. It's not worth the extra strain for the tiny amount of extra compression you would see.

So now you know that this is working and you can proceed to add php.ini file to additional directories or folders.

Recommended areas to add php.ini for Dolphin 7:
/php.ini
/modules/boonex/module-name/php.ini

Where module-name = the particular module such as blogs.

To add zlib compression to blogs:
/modules/boonex/blogs/php.ini


Once you have php.ini added to the Dolphin 7 modules directory or folder you can easily verify with mozilla firefox.

With firefox simply navigate to a blog post and choose tools...page info. You will see something like:

With zlib compression: (Notice it is 12.6 KB in text size)

With zlib compression



Without zlib compression blog post: (Much larger without compression it is 58.45 KB in text size)

Without zlib compression



Both with and without zlib compression were tested with:
How To Speed Up Dolphin


And this is in addition to the standard Dolphin 7 cache feature enabled:

With Dolphin 7 Cache



#fast-cgi

For those that have fast-cgi server setup or configuration you might get by with just 1 php.ini file in your main, home, root directory (yoursite.com/php.ini). With some hosting setups the 1 php.ini file will cover all directories below or under it. Other times you need to do the same as suphp and add a php.ini file to each directory or folder. Save yourself some time and simply ask your host.

Other than that you just need to either edit your current php.ini file or add to it with the same as the suphp information above like:

zlib.output_compression = on
zlib.output_compression_level = 1
zlib.output_handler = zlib.output_compression

Your host would need zlib compression available on the server. Check the above suphp for more information.

If you have the full php.ini file and they are commented out such as:
;zlib.output_compression = Off

You would simply remove the comment (;) and change Off to On like:
zlib.output_compression = On



#mod_php / apache handler / dso

For those of you that have a host that uses mod_php / apache handler / dso type of setup or configuration you will need to add to your main .htaccess file. (yoursite.com/.htaccess).

Again zlib.output_compression should be available which you can read about above in the suphp information area above.

You will want to make sure you download and backup your original .htaccess file (yoursite.com/.htaccess) or path to Dolphin 7 main .htaccess before proceeding. Htaccess files are very particular. One line or character out of whack and it can take your whole site down with a 500 internal server error. So be sure to have a backup .htaccess file handy just in case.

Then open your main Dolphin 7 .htaccess file (yoursite.com/.htaccess) with your favorite editor and add the following:

<IfModule mod_php4.c>
php_flag zlib.output_compression on
php_value zlib.output_compression_level 1
</IfModule>

<IfModule mod_php5.c>
php_flag zlib.output_compression on
php_value zlib.output_compression_level 1
</IfModule>



Save it back to your host or hosting account. Then, refresh your Dolphin 7 site a few times. You might consider clearing your Dolphin 7 Administration cache.

I do not have access to a mod_php / apache handler / dso server at the time I am typing this so I am unable to test it completely.

You might also try:

<IfModule mod_php5.c>
php_flag zlib.output_compression on
php_value zlib.output_compression_level 1
php_value zlib.output_handler zlib.output_compression
</IfModule>



Additional:

Before uploading and making changes to php.ini or .htaccess be sure to check page sizes with firefox both before and after to verify.

You may need to clear Administration Panel Cache, and refresh your site or page several times before it takes effect.

If you do not have firefox you can use a site to test such as:

http://www.gidnetwork.com/tools/gzip-test.php

Enter in your various Dolphin 7 pages into the Web Page URL and it will tell you if the page is compressed. Original size, compressed size and the compression %.

You should expect to see 70-85% compression for most of your pages if you have it working right.


If you get a lot of traffic, visitors, or members you could potentially save quite a bit of bandwidth over the course of a month, as well as make your web site's pages load faster.

Even if you have plenty of bandwidth or one of those so-called unlimited bandwidth plans it is still a very good idea to optimize which will help make your pages load faster.



Finally:

If your host has zlib compression available and has the server configured or setup right you can potentially:

1. Use Dolphin 7's Administration Cache abilities
2. Add Boonex suggested compression near the bottom (Web-server section) at: http://www.boonex.com/trac/dolphin/wiki/HostingServerSetupRecommendations
3. Add zlib compression as outlined in this tutorial.

(Or a combination that works best for your web site).


I hope to add another dolphin tutorial that will include additional speed improvements you can apply to your web site soon.

 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Recommend
Sponsored Links