DeveloperSide.NET Forums
December 14, 2019, 04:50:47 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to change Gzip compression setting.  (Read 21338 times)
0 Members and 1 Guest are viewing this topic.
TazDevilLooney
Customer, Basic Support
Jr. Member
*****
Posts: 30



View Profile
« on: April 28, 2010, 12:13:52 PM »

Hi, does anyone know were i can change the Gzip compression setting. I'm under the understanding there is 9 settings 1-9.

What compression level is the suite shiped with? And were would i be able to change the settings?

Thankyou
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: April 28, 2010, 06:05:55 PM »

File C:\www\Apache22\conf\extra\suite-global\suite-deflate_logio.conf

http://httpd.apache.org/docs/2.2/mod/mod_deflate.html#deflatecompressionlevel

You would add this directive within the existing "<IfModule deflate_module>" block: DeflateCompressionLevel value

I think the linked in zlib library defaults to a value of 6.
« Last Edit: April 28, 2010, 11:21:43 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
TazDevilLooney
Customer, Basic Support
Jr. Member
*****
Posts: 30



View Profile
« Reply #2 on: April 30, 2010, 01:12:17 AM »

Hi there,

I have tryed what you suggested but could not get any results that was diffrent with googles pagespeed.

I tryed compression setting 1 & 9 and there was no diffrence in compression size of the files.

However if the suit is set at compression level 6 i think that would be high enough anyway.

Thanks for checking this out for me...

one other question im getting problems with and i dont know if you can help me with this one.

The system seems to have trouble compressing some files.

yuiloader-dom-event.js?v=403  could save 38.3KiB (67% reduction)
treeview-min.js could save 22.9KiB (72% reduction)

I have 9 of these in total all in the same dir. But can't understand why. I guess the 403 on the end means forbidden.
However the site loads external and internaly with no problems.

If i can get these to compress i can save 128KB (70% reduction). which to you probably sounds a small amount. To me thats over a second on upload. Is the google page speed telling me lie's or is there some other way i can test things are compressing.

This is my suite-deflate_logio.conf

Code:
LoadModule logio_module modules/mod_logio.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-agent}i\"" combinedtrueout
LogFormat "%V %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-agent}i\"" combinedtrueout_host
CustomLog logs/access.log combinedtrueout_host
</IfModule>

<IfModule !logio_module>
CustomLog logs/access.log combined
</IfModule>

<IfModule deflate_module>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate.log deflate
           
<Location />

AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

<IfModule headers_module>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</Location>
</IfModule>

</IfModule>


Many thanks and sorry for the late reply.....

Taz
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: April 30, 2010, 01:52:25 PM »

To compress javascript files, you could try editing this line:
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml

To:
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/javascript application/x-javascript

Restart Apache for changes to take effect.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
TazDevilLooney
Customer, Basic Support
Jr. Member
*****
Posts: 30



View Profile
« Reply #4 on: May 01, 2010, 01:03:31 PM »

To compress javascript files, you could try editing this line:
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml

To:
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/javascript application/x-javascript

Restart Apache for changes to take effect.

Thankyou, Still shows uncompressed in google page speed. But this has to be working, surely.
Maybe its a bug with there software.

Thanks again, Taz
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #5 on: May 01, 2010, 04:49:58 PM »

When Apache serves a request, it checks the C:\www\Apache22\conf\mime.types file with the extension of the file being served, and sets the "Content-Type" HTTP header to...
(line 62)
Quote
application/javascript js

"application/javascript"

Then the mod_deflate module has a chance to act on "application/javascript" content type data when it gets it.

To test this, I placed a deflate.js text file under localhost and accessed it. mod_deflate keeps a log file for localhost here:
C:\www\Apache22\logs\localhost\deflate.log

Quote
"GET /deflate.js HTTP/1.1" 43305/759469 (5%)

mod_deflate compressed the 750KB file down to 43KB, to about 5% of original size.
« Last Edit: May 01, 2010, 05:13:21 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!