|
|
|
|
|
|
| Author |
Message |
Apache User *nix forums beginner
Joined: 19 Jul 2006
Posts: 2
|
Posted: Wed Jul 19, 2006 11:49 pm Post subject:
mod_deflate/mod_mem_cache issues
|
|
|
Hi,
I have an Apache 2.2.2 setup on a Redhat box. Mod_proxy(mod_proxy_ajp) is
being used to connect to tomcat on the same machine. Caching is implemented
using mod_cache(mod_mem_cache). This setup works fine and caching seems to
be working as expected.
The problem occurs when I try to optimize further by supporting HTML
compression using mod_deflate. In this case, whenever deflated documents are
served by the cache the Content-length returned is 0. Is this a known issue
? Can mod_deflate and mod_mem_cache be used together ? Or is it that
mod_mem_cache cannot handle compressed content ?
Here's the output from lwp-request( the second one shows the serving up of
cached content)
[root@bin]# lwp-request -uedsx http://localhost:80/Main.do -H
Accept-Encoding:gzip,deflate
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://localhost:80/Main.do
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 670 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 3002 bytes
LWP::UserAgent::request: Simple response: OK
GET http://localhost:80/Main.do
200 OK
Cache-Control: no-store, must-revalidate, post-check=0, pre-check=0
Connection: close
Date: Tue, 18 Jul 2006 18:27:35 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 7768
Content-Type: text/html;charset=ISO-8859-1
Expires: Tue, 18 Jul 2006 18:30:37 GMT
Last-Modified: Tue, 18 Jul 2006 18:27:37 GMT
Client-Date: Tue, 18 Jul 2006 18:27:37 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
[root@bin]# lwp-request -uedsx http://localhost:80/Main.do -H
Accept-Encoding:gzip,deflate
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://localhost:80/Main.do
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: OK
GET http://localhost:80/Main.do
200 OK
Cache-Control: no-store, must-revalidate, post-check=0, pre-check=0
Connection: close
Date: Tue, 18 Jul 2006 18:28:32 GMT
Age: 56
Server: Apache/2.2.2 (Unix)
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 0
Content-Type: text/html;charset=ISO-8859-1
Expires: Tue, 18 Jul 2006 18:30:37 GMT
Last-Modified: Tue, 18 Jul 2006 18:27:37 GMT
Client-Date: Tue, 18 Jul 2006 18:28:32 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
Here's the deflate.log contents
"GET /Main.do HTTP/1.1" 7750/35169 (22%)
"GET /Main.do HTTP/1.1" -/- (-%)
Relevant sections of my httpd.conf:
LoadModule cache_module modules/mod_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#
# mod_expires settings
#
<IfModule expires_module>
ExpiresActive On
ExpiresByType text/css "access plus 1 day"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
</IfModule>
#
# mod_proxy/mod_proxy ajp settings
#
<IfModule proxy_module>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /favicon.ico !
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</IfModule>
#
# mod_cache/mod_mem_cache settings
#
<IfModule cache_module>
<IfModule mem_cache_module>
CacheEnable mem /
CacheStoreNoStore On
# CacheIgnoreCacheControl On
# CacheIgnoreNoLastMod On
# CacheMaxExpire 150
MCacheSize 4096
MCacheMaxObjectCount 200
MCacheMinObjectSize 1
MCacheMaxObjectSize 524288
</IfModule>
</IfModule>
#
# Worker MPM settings
#
<IfModule mpm_worker_module>
StartServers 1
MaxClients 250
ThreadsPerChild 50
MinSpareThreads 25
MaxSpareThreads 75
</IfModule>
<IfModule deflate_module>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip)$ no-gzip
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate.log deflate
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<IfModule headers_module>
Header append Vary User-Agent
</IfModule>
</IfModule>
Any insight, suggestions or assistance with this would be very much
appreciated. Thank you.
--S
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org |
|
| Back to top |
|
 |
Joshua Slive *nix forums Guru
Joined: 07 Feb 2005
Posts: 1647
|
Posted: Thu Jul 20, 2006 12:01 am Post subject:
Re: mod_deflate/mod_mem_cache issues
|
|
|
On 7/19/06, Apache User <apacheuser123@hotmail.com> wrote:
| Quote: | Hi,
I have an Apache 2.2.2 setup on a Redhat box. Mod_proxy(mod_proxy_ajp) is
being used to connect to tomcat on the same machine. Caching is implemented
using mod_cache(mod_mem_cache). This setup works fine and caching seems to
be working as expected.
The problem occurs when I try to optimize further by supporting HTML
compression using mod_deflate. In this case, whenever deflated documents are
served by the cache the Content-length returned is 0. Is this a known issue
? Can mod_deflate and mod_mem_cache be used together ? Or is it that
mod_mem_cache cannot handle compressed content ?
|
I don't have any specific info on this problem, but I'd highly
recommend using mod_disk_cache in place of mod_mem_cache. It is
better tested, and will be more performant in most scenarios.
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org |
|
| Back to top |
|
 |
Apache User *nix forums beginner
Joined: 19 Jul 2006
Posts: 2
|
Posted: Thu Jul 20, 2006 6:57 pm Post subject:
Re: mod_deflate/mod_mem_cache issues
|
|
|
Thanks for the help, Joshua. I configured apache to use mod_disk_cache and
it seems to be working and compressed content is getting served up
correctly. Guess that means it is a bug in mod_mem_cache ?
I still have to run some tests to check the performance of (caching on disk
+ compression) vs ( caching in memory) though.
| Quote: | From: "Joshua Slive" <joshua@slive.ca
Reply-To: users@httpd.apache.org
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_deflate/mod_mem_cache issues
Date: Wed, 19 Jul 2006 20:01:48 -0400
On 7/19/06, Apache User <apacheuser123@hotmail.com> wrote:
Hi,
I have an Apache 2.2.2 setup on a Redhat box. Mod_proxy(mod_proxy_ajp) is
being used to connect to tomcat on the same machine. Caching is
implemented
using mod_cache(mod_mem_cache). This setup works fine and caching seems to
be working as expected.
The problem occurs when I try to optimize further by supporting HTML
compression using mod_deflate. In this case, whenever deflated documents
are
served by the cache the Content-length returned is 0. Is this a known
issue
? Can mod_deflate and mod_mem_cache be used together ? Or is it that
mod_mem_cache cannot handle compressed content ?
I don't have any specific info on this problem, but I'd highly
recommend using mod_disk_cache in place of mod_mem_cache. It is
better tested, and will be more performant in most scenarios.
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
|
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Mon Dec 01, 2008 7:20 pm | All times are GMT
|
|
Houses for Sale | Remortgages | Credit Cards | Web Games | Online Advertising
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|