Compression testers wanted

Basti

Administrator
Staff member
Hey all, in the effort to make VisioList load fast and more server friendly we are currently testing site compression methods.

One which takes the less trouble is apaches mod_deflate. I already tested it out on my own site and got 85% compression rate for my homepage and roughly 75-80% for inner pages/css/js files

If possible i would like to use this method, as we can easily compress javascript, css, xml, images via a few lines. It also takes care of unsupported browsers, proxy services.
With the php method we can easily compress php files as well, but applying that to the js, css etc is more work and also require work on your end which we want to avoid.

So, for this i would like to have a few beta testers, who test this until the end of December, as we wish to release VisioList 0.9 on 31th finally.

What do you have to do?
1) First off, here is a tool which checks your page size and compression rate and speed test in one
http://www.testthisurl.com/
Use this tool to test for both gzip and speed test in one. Refresh it a few times to get some average info ( connection speed varies as you maybe, or not know )
Most speed test sites does not accept any compression and simply serve original content. Most of these sites use php´s curl function for the test and if a option called "CURLOPT_ENCODING" is not set, they ignore it and server original content for the response.
So if you use a different tool and see no speed / page size improovement, the above is likely the reason
2) Paste this block of code into your .htaccess file at the top using a new line ( .htaccess is located in your topsite root, where settings_sql.php is )
Code:
#######################
## File Compressions ##
#######################
 
<IfModule mod_deflate.c>
# Insert filters
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
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml
 
# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
 
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
3) Revisit the url from above to retest your urls. If it still shows no compression, apaches mod_deflate is most likely turned off. In that case ask your host to turn it on

What i would like to know
Most interested in big sites which list 50+ members per page. But everyone is welcome to test this
1) Compression percent, especially for the homepage
2) Is the site loading faster with this? ( even if not, servers bandwidth should be saved, good for big sites )
3) Do you encounter any errors?

Thanks to everyone who wish to participate :)
 

Bart

Active Member
Before:
http://pokit.org/get/img/3917510e49394a884f284def608cf9f3.png
http://pokit.org/get/img/bd1253f722743f489b403f3da091a413.png


After:
http://pokit.org/get/img/f4710184dba1f7b4b907976e43d92d60.png
http://pokit.org/get/img/ab825721ebbb303d6bab11ae881e8aec.png

My performance grade went down a bit after implementing your .htaccess edit but i think it depends on the server settings, for example i have litespeed instead of apache so i think this wont be useful to Litespeed users, btw i didn't encounter any errors.
 

Mark

Administrator
Staff member
litespeed users should be able to ask their host to enable mod_deflate and take advantage of compression.

LiteSpeed web server is designed to be interchangeable with Apache, the most popular web server. LiteSpeed web server can even run directly from Apache's configuration files.
Currently, functionalities of the following Apache modules have been implemented:
mod_alias, mod_access, mod_auth, mod_cgi, mod_suexec, mod_mime, mod_ssl, mod_php, mod_frontpage, mod_fastcgi, mod_jk, mod_gzip/mod_deflate, mod_throttle, mod_proxy, mod_auth_ldap, mod_rewrite and mod_autoindex.
 

Bart

Active Member
I spoke to the support department and they said this exactly:
"Since we run Litespeed, a version of mod_deflate is already enabled and running on your server."
 

Mark

Administrator
Staff member
can you try removing these 2 lines and see if the performance improves?


<IfModule mod_deflate.c>

</IfModule>
 

Morus

www.votezone.eu , www.privateserversranking.com
License Active
Tested on www.l2.votezone.eu
see below screens from my tests:
website before compression and speed
before compresed.png

speed1.png
Website after compression and speed
after_compression.png

speedafter.png
 

Basti

Administrator
Staff member
I think these tools are not to be much trusted. I ran a speed test etc on several online checker sites, and none seem to accept the compression.
This way be due their checker not accepting compressed data ( note how they still display old page size ). Will investigate this a bit
 

Basti

Administrator
Staff member
http://www.testthisurl.com/
Use this tool instead to test for both gzip and speed test in one. Refresh it a few times to get some everage info ( connection speed varies everywhere )
Most speed test sites indeed does not accept any compression and simply server original content. Most of these sites use php´s curl function and if a option called "CURLOPT_ENCODING" is not set, they ignore it and server original content for the response.
 

leonor

Active Member
License Active
... i am already using Compression on my server, here the result of mine Test.
I am using a Apache Webserver with nginx proxy ...
 

Morus

www.votezone.eu , www.privateserversranking.com
License Active
Some advise for the people that using 1and1 as hosting. I will just explain step by step how to enable mod_deflate
Step 1:
Determine what your root path is; if you are using a 1&1 package, it will look something like this:
Code:
/kunden/homepages/12/d123456789/htdocs/
You can do that by creating a text file in Notepad or other editor,entering the following lines, then saving it with as phpinfo (or whatever you want) followed by the .php extension.
Code:
    <?php
    phpinfo();
    ?>
Step 2:
Create new file and name it headers.php, place the code below and save it in your main directory:
Code:
    <?php
    if (isset($_SERVER['SCRIPT_FILENAME'])) {
    $timestamp = filemtime(__FILE__);
    header('Last-Modified: ' . $timestamp);
    $expires = 60*60*24*14;
    header("Pragma: public");
    header("Cache-Control: maxage=".$expires);
    header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
    header('Vary: Accept-Encoding');
    $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']);
    $extension = $pathinfo['extension'];
    if ($extension == 'css') {
    header('Content-type: text/css');
    }
    if ($extension == 'js') {
    header('Content-type: text/javascript');
    }
    }?>
Step 3:
create file php.ini if you dont have one and add this code using your own root path that you found out in step 1.
Code:
zlib.output_compression=1
auto_prepend_file=/kunden/homepages/46/d339036285/htdocs/YOUR_DOMAIN_FOLDER/headers.php
(If for some reason zlib.output_compression=1 doesn't work, try output_handler=ob_gzhandler instead.)
Step 4:
In the end add code that Basti posted above in step 2:
Code:
#######################
## File Compressions ##
#######################
 
<IfModule mod_deflate.c>
# Insert filters
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
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml
 
 
# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
 
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
 

Basti

Administrator
Staff member
Oh, 1and1 :) Good workaround.

Ill research this is a little more, as a client of mine runs on 1and1 ahsared hosting as well, and it works without any issues at all ( also for css )
 

Basti

Administrator
Staff member
Morus, can you ask your host if your apache version uses mod_fastcgi? and if so, which version?
It appears mod_fastcgi 2.4.6 and earlier stores the Content-Length value in the wrong table and serves it from there, while mod_deflate rewrites the correct Content-Length value, which mod_fastcgi fails to serve then.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509116
Its for debian but appear to be present on other systems as well

Latest Snapshot of mod_fastcgi seems to fixes it according to some sources. Doubt 1and1 would do that though
http://www.fastcgi.com/dist/

Another method seems to be to enable mod_fcgid instead of mod_fastcgi
 

Basti

Administrator
Staff member
Please see my updated post. seems to be a apache module´s issue.
Iam asking Mark tonight what my website runs on to confirm this
 

Morus

www.votezone.eu , www.privateserversranking.com
License Active
I send email to the 1and1 team, waiting for respond.
I know from the phpinfo.php that fastCGI is enabled

Maybe phpinfo will give you more idea.
http://www.l2.votezone.eu/phpinfo.php

Code:
cgi-fcgi
Directive    Local Value    Master Value
cgi.check_shebang_line    1    1
cgi.fix_pathinfo    1    1
cgi.force_redirect    1    1
cgi.nph    0    0
cgi.redirect_status_env    no value    no value
cgi.rfc2616_headers    0    0
fastcgi.logging    1    1
 

Morus

www.votezone.eu , www.privateserversranking.com
License Active
I have reply from 1and1.
"As we have checked mod_fastcgi is supported in Apache 1.3.34"
 

Basti

Administrator
Staff member
i hate 1and1, their support knows nothing...
Ask them what the version number is, they use for their hosting
 

Basti

Administrator
Staff member
On a quick look mod_deflate is not even supported in your apache version.
Why 1and1 run that version since over 7 years is a mistery. But it seems they dont intent to upgrade the apache unless you buy a dedicated server...sucks..
So disregard any tech support headache, keep what you have. Htaccess edits should be save to remove.

Maybe not good to use this by default in visiolist. Or uncomment it until one needs it. Or make a few tutorials, will discuss with mark
 
Top