[users@httpd] mod_deflate/mod_mem_cache issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux