Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

gzip compression only working with SSL

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


graeme.walker1 at gmail

Sep 11, 2007, 3:44 PM

Post #1 of 7 (290 views)
Permalink
gzip compression only working with SSL

Hi,

I am using Apache 2.2.6, with mod_ssl and mod_deflate. I am unable to get
gzip compression working on a non SSL connection. I have the deflate config
in the main httpd.conf, which is identical to my virtual host for SSL,
however only when connecting over SSL does the gzip compression work.

Any help would much appreciated as I have tried everything I can think of.

Cheers
Graeme Walker


Owen.Boyle at swx

Sep 12, 2007, 12:04 AM

Post #2 of 7 (264 views)
Permalink
RE: gzip compression only working with SSL [In reply to]

> -----Original Message-----
> From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> Sent: Wednesday, September 12, 2007 12:45 AM
> To: users [at] httpd
> Subject: [users [at] http] gzip compression only working with SSL
>
> Hi,
>
> I am using Apache 2.2.6, with mod_ssl and mod_deflate. I am
> unable to get gzip compression working on a non SSL
> connection. I have the deflate config in the main httpd.conf,
> which is identical to my virtual host for SSL, however only
> when connecting over SSL does the gzip compression work.

Compression and SSL are orthogonal - that is, they've nothing to do
with each other and shouldn't interfere. So it sounds like a spurious
correlation. What's really the problem is that you have two VHs, one of
which is configured correctly for compression and the other that isn't.

To test, switch off SSL in the SSL-VH (just comment out all SSL
directives and then connect via http on the same port, eg 443). Do you
still get compression?

To investigate, look at the request and response headers (eg, with
liveHTTPHeaders in Firefox). Do they make sense?

To fix, double-check the config; are you sure mod_deflate is configured
the same in both VHs? Also, check content and clients - remember that a
client can refuse to accept compressed content and that some contents
are never compressed (eg, JPG)..

If you don't fix it, post back some config snippets.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.




>
> Any help would much appreciated as I have tried everything I
> can think of.
>
> Cheers
> Graeme Walker
>
>


This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


graeme.walker1 at gmail

Sep 12, 2007, 3:37 AM

Post #3 of 7 (261 views)
Permalink
Re: gzip compression only working with SSL [In reply to]

Hi,

The Request contains the line:

Accept-Encoding: gzip, deflate

Yet the response doesn't have the Content-Encoding: gzip line.

I tried disabling SSL altogether but the the compression still did not work.
I will send on my config files when I get home.

Cheers
Graeme

On 12/09/2007, Boyle Owen <Owen.Boyle [at] swx> wrote:
>
> > -----Original Message-----
> > From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> > Sent: Wednesday, September 12, 2007 12:45 AM
> > To: users [at] httpd
> > Subject: [users [at] http] gzip compression only working with SSL
> >
> > Hi,
> >
> > I am using Apache 2.2.6, with mod_ssl and mod_deflate. I am
> > unable to get gzip compression working on a non SSL
> > connection. I have the deflate config in the main httpd.conf,
> > which is identical to my virtual host for SSL, however only
> > when connecting over SSL does the gzip compression work.
>
> Compression and SSL are orthogonal - that is, they've nothing to do
> with each other and shouldn't interfere. So it sounds like a spurious
> correlation. What's really the problem is that you have two VHs, one of
> which is configured correctly for compression and the other that isn't.
>
> To test, switch off SSL in the SSL-VH (just comment out all SSL
> directives and then connect via http on the same port, eg 443). Do you
> still get compression?
>
> To investigate, look at the request and response headers (eg, with
> liveHTTPHeaders in Firefox). Do they make sense?
>
> To fix, double-check the config; are you sure mod_deflate is configured
> the same in both VHs? Also, check content and clients - remember that a
> client can refuse to accept compressed content and that some contents
> are never compressed (eg, JPG)..
>
> If you don't fix it, post back some config snippets.
>
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
>
>
>
>
> >
> > Any help would much appreciated as I have tried everything I
> > can think of.
> >
> > Cheers
> > Graeme Walker
> >
> >
>
>
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission. If
> you receive this message in error, please notify the sender urgently and
> then immediately delete the message and any copies of it from your system.
> Please also immediately destroy any hardcopies of the message. You must not,
> directly or indirectly, use, disclose, distribute, print, or copy any part
> of this message if you are not the intended recipient. The sender's company
> reserves the right to monitor all e-mail communications through their
> networks. Any views expressed in this message are those of the individual
> sender, except where the message states otherwise and the sender is
> authorised to state them to be the views of the sender's company.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


Owen.Boyle at swx

Sep 12, 2007, 5:26 AM

Post #4 of 7 (276 views)
Permalink
RE: gzip compression only working with SSL [In reply to]

> -----Original Message-----
> From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> Sent: Wednesday, September 12, 2007 12:38 PM
> To: users [at] httpd
> Subject: Re: [users [at] http] gzip compression only working with SSL
>
> Hi,
>
> The Request contains the line:
>
> Accept-Encoding: gzip, deflate

Good.

>
> Yet the response doesn't have the Content-Encoding: gzip line.
>
> I tried disabling SSL altogether but the the compression
> still did not work.

You mis-understand. My conjecture is that SSL has nothing to do with
your problem. To prove this conjecture, I asked you to switch off SSL in
the SSL VH and then show that compression *still* works in that VH, even
with SSL off.

If you can demonstrate this, then you can forget about SSL and
concentrate on fixing the mod_gzip config problem...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.


> I will send on my config files when I get home.
>
> Cheers
> Graeme
>
>
> On 12/09/2007, Boyle Owen <Owen.Boyle [at] swx> wrote:
>
> > -----Original Message-----
> > From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> > Sent: Wednesday, September 12, 2007 12:45 AM
> > To: users [at] httpd <mailto:users [at] httpd>
> > Subject: [users [at] http] gzip compression only working with SSL
> >
> > Hi,
> >
> > I am using Apache 2.2.6, with mod_ssl and mod_deflate. I am
> > unable to get gzip compression working on a non SSL
> > connection. I have the deflate config in the main httpd.conf,
> > which is identical to my virtual host for SSL, however only
> > when connecting over SSL does the gzip compression work.
>
> Compression and SSL are orthogonal - that is, they've
> nothing to do
> with each other and shouldn't interfere. So it sounds
> like a spurious
> correlation. What's really the problem is that you have
> two VHs, one of
> which is configured correctly for compression and the
> other that isn't.
>
> To test, switch off SSL in the SSL-VH (just comment out all SSL
> directives and then connect via http on the same port,
> eg 443). Do you
> still get compression?
>
> To investigate, look at the request and response
> headers (eg, with
> liveHTTPHeaders in Firefox). Do they make sense?
>
> To fix, double-check the config; are you sure
> mod_deflate is configured
> the same in both VHs? Also, check content and clients -
> remember that a
> client can refuse to accept compressed content and that
> some contents
> are never compressed (eg, JPG)..
>
> If you don't fix it, post back some config snippets.
>
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may
> be ignored.
>
>
>
>
> >
> > Any help would much appreciated as I have tried everything I
> > can think of.
> >
> > Cheers
> > Graeme Walker
> >
> >
>
>
> This message is for the named person's use only. It may
> contain confidential, proprietary or legally privileged
> information. No confidentiality or privilege is waived or
> lost by any mistransmission. If you receive this message in
> error, please notify the sender urgently and then immediately
> delete the message and any copies of it from your system.
> Please also immediately destroy any hardcopies of the
> message. You must not, directly or indirectly, use, disclose,
> distribute, print, or copy any part of this message if you
> are not the intended recipient. The sender's company reserves
> the right to monitor all e-mail communications through their
> networks. Any views expressed in this message are those of
> the individual sender, except where the message states
> otherwise and the sender is authorised to state them to be
> the views of the sender's company.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache
> HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html > for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest:
> users-digest-unsubscribe [at] httpd
> <mailto:users-digest-unsubscribe [at] httpd>
> For additional commands, e-mail: users-help [at] httpd
>
>
>
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


graeme.walker1 at gmail

Sep 12, 2007, 10:54 AM

Post #5 of 7 (260 views)
Permalink
Re: gzip compression only working with SSL [In reply to]

Hi,

I removed the SSL parts of the virtual host and changed the port to 80 and
the compression doesn't work. Please find below my config for the virtual
host both for port 80 and SSL

Thanks for your help so far.

Cheers
Graeme

Normal VH
========
Listen 80

<VirtualHost *:80>
ServerName <domain>
DocumentRoot "D:/Website_Dev/cimage"
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml
text/javascript application/x-javascript application/xml
application/xhtml+xml
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
DeflateCompressionLevel 9
LogFormat '%t %r %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_main.log deflate
</VirtualHost>

SSL VH
======
Listen 443
AddType application/x-x509-ca-cert .cer
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache shmcb:c:/Apache2/logs/ssl_scache(512000)
SSLSessionCacheTimeout 300

<VirtualHost _default_:443>
DocumentRoot "D:/Website_Dev/cimage"
ServerName <domain>:443
SSLEngine on
SSLProtocol -all +SSLv2 +SSLv3
SSLCipherSuite DHE-RSA-AES256-SHA:RC4+RSA:+HIGH:+MEDIUM:+SSLv2:+eNULL
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
text/javascript application/xml application/xhtml+xml
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
DeflateCompressionLevel 9
LogFormat '%t %r %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_main.log deflate
</VirtualHost>

On 12/09/2007, Boyle Owen <Owen.Boyle [at] swx> wrote:
>
>
>
> > -----Original Message-----
> > From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> > Sent: Wednesday, September 12, 2007 12:38 PM
> > To: users [at] httpd
> > Subject: Re: [users [at] http] gzip compression only working with SSL
> >
> > Hi,
> >
> > The Request contains the line:
> >
> > Accept-Encoding: gzip, deflate
>
> Good.
>
> >
> > Yet the response doesn't have the Content-Encoding: gzip line.
> >
> > I tried disabling SSL altogether but the the compression
> > still did not work.
>
> You mis-understand. My conjecture is that SSL has nothing to do with
> your problem. To prove this conjecture, I asked you to switch off SSL in
> the SSL VH and then show that compression *still* works in that VH, even
> with SSL off.
>
> If you can demonstrate this, then you can forget about SSL and
> concentrate on fixing the mod_gzip config problem...
>
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
>
>
> > I will send on my config files when I get home.
> >
> > Cheers
> > Graeme
> >
> >
> > On 12/09/2007, Boyle Owen <Owen.Boyle [at] swx> wrote:
> >
> > > -----Original Message-----
> > > From: Graeme Walker [mailto:graeme.walker1 [at] gmail]
> > > Sent: Wednesday, September 12, 2007 12:45 AM
> > > To: users [at] httpd <mailto:users [at] httpd>
> > > Subject: [users [at] http] gzip compression only working with SSL
> > >
> > > Hi,
> > >
> > > I am using Apache 2.2.6, with mod_ssl and mod_deflate. I am
> > > unable to get gzip compression working on a non SSL
> > > connection. I have the deflate config in the main httpd.conf,
> > > which is identical to my virtual host for SSL, however only
> > > when connecting over SSL does the gzip compression work.
> >
> > Compression and SSL are orthogonal - that is, they've
> > nothing to do
> > with each other and shouldn't interfere. So it sounds
> > like a spurious
> > correlation. What's really the problem is that you have
> > two VHs, one of
> > which is configured correctly for compression and the
> > other that isn't.
> >
> > To test, switch off SSL in the SSL-VH (just comment out all SSL
> > directives and then connect via http on the same port,
> > eg 443). Do you
> > still get compression?
> >
> > To investigate, look at the request and response
> > headers (eg, with
> > liveHTTPHeaders in Firefox). Do they make sense?
> >
> > To fix, double-check the config; are you sure
> > mod_deflate is configured
> > the same in both VHs? Also, check content and clients -
> > remember that a
> > client can refuse to accept compressed content and that
> > some contents
> > are never compressed (eg, JPG)..
> >
> > If you don't fix it, post back some config snippets.
> >
> > Rgds,
> > Owen Boyle
> > Disclaimer: Any disclaimer attached to this message may
> > be ignored.
> >
> >
> >
> >
> > >
> > > Any help would much appreciated as I have tried everything I
> > > can think of.
> > >
> > > Cheers
> > > Graeme Walker
> > >
> > >
> >
> >
> > This message is for the named person's use only. It may
> > contain confidential, proprietary or legally privileged
> > information. No confidentiality or privilege is waived or
> > lost by any mistransmission. If you receive this message in
> > error, please notify the sender urgently and then immediately
> > delete the message and any copies of it from your system.
> > Please also immediately destroy any hardcopies of the
> > message. You must not, directly or indirectly, use, disclose,
> > distribute, print, or copy any part of this message if you
> > are not the intended recipient. The sender's company reserves
> > the right to monitor all e-mail communications through their
> > networks. Any views expressed in this message are those of
> > the individual sender, except where the message states
> > otherwise and the sender is authorised to state them to be
> > the views of the sender's company.
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache
> > HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html > for more info.
> > To unsubscribe, e-mail: users-unsubscribe [at] httpd
> > " from the digest:
> > users-digest-unsubscribe [at] httpd
> > <mailto:users-digest-unsubscribe [at] httpd>
> > For additional commands, e-mail: users-help [at] httpd
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


joshua at slive

Sep 12, 2007, 12:20 PM

Post #6 of 7 (260 views)
Permalink
Re: gzip compression only working with SSL [In reply to]

On 9/12/07, Graeme Walker <graeme.walker1 [at] gmail> wrote:
> Hi,
>
> I removed the SSL parts of the virtual host and changed the port to 80 and
> the compression doesn't work. Please find below my config for the virtual
> host both for port 80 and SSL
>
> Thanks for your help so far.
>
> Cheers
> Graeme
>
> Normal VH
> ========
> Listen 80
>
> <VirtualHost *:80>
> ServerName <domain>
> DocumentRoot "D:/Website_Dev/cimage"
> SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
> no-gzip dont-vary
> SetEnvIfNoCase Request_URI \
> \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
> no-gzip dont-vary
> SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
> AddOutputFilterByType DEFLATE text/html text/plain text/xml
> text/javascript application/x-javascript application/xml
> application/xhtml+xml
> DeflateFilterNote Input instream
> DeflateFilterNote Output outstream
> DeflateFilterNote Ratio ratio
> DeflateCompressionLevel 9
> LogFormat '%t %r %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
> CustomLog logs/deflate_main.log deflate
> </VirtualHost>

AddOutputFilterByType is not reliable with dynamic content. And in any
case, since you have specific exclusions for everything you don't want
gzipped, it doesn't seem necessary. You should just use
SetOutputFilter DEFLATE

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


graeme.walker1 at gmail

Sep 12, 2007, 12:34 PM

Post #7 of 7 (258 views)
Permalink
Re: gzip compression only working with SSL [In reply to]

Still no luck. This seems to be a weird error. I'm using mod_aspdotnet. I
wonder if thats what is preventing the gzip compression for non SSL
connections?

Cheers
Graeme

On 12/09/2007, Joshua Slive <joshua [at] slive> wrote:
>
> On 9/12/07, Graeme Walker <graeme.walker1 [at] gmail> wrote:
> > Hi,
> >
> > I removed the SSL parts of the virtual host and changed the port to 80
> and
> > the compression doesn't work. Please find below my config for the
> virtual
> > host both for port 80 and SSL
> >
> > Thanks for your help so far.
> >
> > Cheers
> > Graeme
> >
> > Normal VH
> > ========
> > Listen 80
> >
> > <VirtualHost *:80>
> > ServerName <domain>
> > DocumentRoot "D:/Website_Dev/cimage"
> > SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
> > no-gzip dont-vary
> > SetEnvIfNoCase Request_URI \
> > \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
> > no-gzip dont-vary
> > SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
> > AddOutputFilterByType DEFLATE text/html text/plain text/xml
> > text/javascript application/x-javascript application/xml
> > application/xhtml+xml
> > DeflateFilterNote Input instream
> > DeflateFilterNote Output outstream
> > DeflateFilterNote Ratio ratio
> > DeflateCompressionLevel 9
> > LogFormat '%t %r %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
> > CustomLog logs/deflate_main.log deflate
> > </VirtualHost>
>
> AddOutputFilterByType is not reliable with dynamic content. And in any
> case, since you have specific exclusions for everything you don't want
> gzipped, it doesn't seem necessary. You should just use
> SetOutputFilter DEFLATE
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.