You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Anthony J. Biacco" <ab...@formatdynamics.com> on 2008/09/05 19:20:20 UTC

[users@httpd] mod_rewrite bug/by design with mod_mem_cache cached files?

Hi,

I'm using apache 2.2.9 with mod_mem_cache to cache some javascript
files, which is working fine.

Today, I added a rewrite rule to forbid access (403) to everything in a
virtualhost based on the Opera browser, which obviously included the
javascript files.

Problem is, the cached files in memory weren't getting forbidden, yet
everything non-cached was.
If I turn off mod_mem_cache, everything gets forbidden as it should.

Is there either a bug in the rewrite or caching modules that is allowing
this rule to get circumvented? Is it by design? Am I messing up my
config?

Here's what I have in my virtualhost config..

RewriteCond %{HTTP_USER_AGENT} ^.*(opera).*$ [NC]
RewriteRule ^(.*)$ - [F,L]

<IfModule mod_cache.c>
                CacheDefaultExpire 300
                CacheEnable mem /js
                CacheEnable mem /images
        <IfModule mod_mem_cache.c>
                CacheIgnoreQueryString On
                MCacheRemovalAlgorithm LRU
                MCacheMaxObjectCount 100
                MCacheMaxObjectSize 150000
                MCacheMinObjectSize 10
                MCacheSize 10240
        </IfModule>
</IfModule>

Here are sample back-to-back log entries (note, last parameter in log
line is %{Age}o"
129.7.109.142 - - [05/Sep/2008:08:13:25 -0600] "GET /js/2273/pd.js?ps=6
HTTP/1.1" 200 7545 "REFERER" "Opera/9.50 (Windows NT 5.1; U; en)" 1
129.7.109.142 - - [05/Sep/2008:08:13:27 -0600] "GET
/cp/psj?killCache=1220624007222&divId=2273&printSpecId=6 HTTP/1.1" 403
15 "REFERER" "Opera/9.50 (Windows NT 5.1; U; en)" -

-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com
http://www.formatdynamics.com



---------------------------------------------------------------------
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


RE: [users@httpd] mod_rewrite bug/by design with mod_mem_cache cached files?

Posted by "Anthony J. Biacco" <ab...@formatdynamics.com>.
Thanx for that.

-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com
http://www.formatdynamics.com


-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Friday, September 05, 2008 12:13 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite bug/by design with mod_mem_cache
cached files?

On Fri, Sep 5, 2008 at 1:20 PM, Anthony J. Biacco
<ab...@formatdynamics.com> wrote:
> Hi,
>
> I'm using apache 2.2.9 with mod_mem_cache to cache some javascript
> files, which is working fine.
>
> Today, I added a rewrite rule to forbid access (403) to everything in
a
> virtualhost based on the Opera browser, which obviously included the
> javascript files.

top of http://httpd.apache.org/docs/2.2/mod/mod_cache.html :

This module should be used with care and can be used to circumvent
Allow and Deny directives. You should not enable caching for any
content to which you wish to limit access by client host name, address
or environment variable.

Once the cache is on, it gets served so early that these modules don't
get to run.
-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite bug/by design with mod_mem_cache cached files?

Posted by Eric Covener <co...@gmail.com>.
On Fri, Sep 5, 2008 at 1:20 PM, Anthony J. Biacco
<ab...@formatdynamics.com> wrote:
> Hi,
>
> I'm using apache 2.2.9 with mod_mem_cache to cache some javascript
> files, which is working fine.
>
> Today, I added a rewrite rule to forbid access (403) to everything in a
> virtualhost based on the Opera browser, which obviously included the
> javascript files.

top of http://httpd.apache.org/docs/2.2/mod/mod_cache.html :

This module should be used with care and can be used to circumvent
Allow and Deny directives. You should not enable caching for any
content to which you wish to limit access by client host name, address
or environment variable.

Once the cache is on, it gets served so early that these modules don't
get to run.
-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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