niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Apache
mod_deflate/mod_mem_cache issues
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Apache User
*nix forums beginner


Joined: 19 Jul 2006
Posts: 2

PostPosted: Wed Jul 19, 2006 11:49 pm    Post subject: mod_deflate/mod_mem_cache issues Reply with 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 ?

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

PostPosted: Thu Jul 20, 2006 12:01 am    Post subject: Re: mod_deflate/mod_mem_cache issues Reply with quote

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

PostPosted: Thu Jul 20, 2006 6:57 pm    Post subject: Re: mod_deflate/mod_mem_cache issues Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 7:20 pm | All times are GMT
navigation Forum index » Apps » Apache
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix SMTP client issues damber Postfix 1 Sat Apr 19, 2008 11:33 am
No new posts Dynamic IP Issues, when Sever is on Fixed. spode Postfix 2 Tue Aug 14, 2007 2:10 pm
No new posts postfix dovecot mysql issues gnetcon Postfix 0 Thu Aug 03, 2006 9:19 pm
No new posts PHP Installation issues on WinXP and IIS ~john PHP 3 Thu Jul 20, 2006 4:14 pm
No new posts USB phone issues Keve Nagy FreeBSD 1 Tue Jul 18, 2006 12:08 pm

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
[ Time: 0.2358s ][ Queries: 16 (0.0785s) ][ GZIP on - Debug on ]