You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by "Anthony J. Biacco" <ab...@formatdynamics.com> on 2010/03/02 02:36:37 UTC

rewrite processing before cache

I asked a vaguely similar question about a year ago, but this one is a
little more simplistic in comparison.

Running 2.2.14 on linux, disk caching a servlet's output, not ignoring
query string as that can change the output, and not using
cacheignoreheaders.

My problem is, using rewrite rules on such requests don't always get
triggered.
For example, if I'm trying to block a browser through a rewrite rule for
a request to said servlet, sometimes the cache takes over and serves the
cached output instead of following the rewrite. i.e. sometimes the
browser will get blocked and sometimes it will get cached content.
I'm wondering what's the workflow on such a scenario, and how can I
configure it so the rewrite always gets processed before a cache check,
if possible.

Thanx,

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



RE: rewrite processing before cache

Posted by "Anthony J. Biacco" <ab...@formatdynamics.com>.
Yeah, so I tested this out by putting Vary on for User-Agent..that's not
gonna fly. Went from having 3500 cache entries to 45000 and still
increasing at a rate to which my tomcat servlet and in turn my mysql is
up to 20 queries/s versus 5/s.
Now if I knew there was an end in sight, maybe I could hold out hope.
:-)

-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: Monday, March 01, 2010 6:50 PM
> To: modules-dev@httpd.apache.org
> Subject: Re: rewrite processing before cache
> 
> On Mon, Mar 1, 2010 at 8:36 PM, Anthony J. Biacco
> <ab...@formatdynamics.com> wrote:
> > I asked a vaguely similar question about a year ago, but this one is
> a
> > little more simplistic in comparison.
> >
> > Running 2.2.14 on linux, disk caching a servlet's output, not
> ignoring
> > query string as that can change the output, and not using
> > cacheignoreheaders.
> >
> > My problem is, using rewrite rules on such requests don't always get
> > triggered.
> > For example, if I'm trying to block a browser through a rewrite rule
> for
> > a request to said servlet, sometimes the cache takes over and serves
> the
> > cached output instead of following the rewrite. i.e. sometimes the
> > browser will get blocked and sometimes it will get cached content.
> > I'm wondering what's the workflow on such a scenario, and how can I
> > configure it so the rewrite always gets processed before a cache
> check,
> > if possible.
> 
> Trunk has a feature called "CacheQuickHandler" that stops the cache
> from short-circuiting all the local processing, but not available in
> 2.2.x.
> 
> The other option you have is to add a Vary header for user-agent, but
> that makes you store a ton of different copies in your cache due to
> the variety in user-agents.
> 
> --
> Eric Covener
> covener@gmail.com

Re: rewrite processing before cache

Posted by Eric Covener <co...@gmail.com>.
On Mon, Mar 1, 2010 at 8:36 PM, Anthony J. Biacco
<ab...@formatdynamics.com> wrote:
> I asked a vaguely similar question about a year ago, but this one is a
> little more simplistic in comparison.
>
> Running 2.2.14 on linux, disk caching a servlet's output, not ignoring
> query string as that can change the output, and not using
> cacheignoreheaders.
>
> My problem is, using rewrite rules on such requests don't always get
> triggered.
> For example, if I'm trying to block a browser through a rewrite rule for
> a request to said servlet, sometimes the cache takes over and serves the
> cached output instead of following the rewrite. i.e. sometimes the
> browser will get blocked and sometimes it will get cached content.
> I'm wondering what's the workflow on such a scenario, and how can I
> configure it so the rewrite always gets processed before a cache check,
> if possible.

Trunk has a feature called "CacheQuickHandler" that stops the cache
from short-circuiting all the local processing, but not available in
2.2.x.

The other option you have is to add a Vary header for user-agent, but
that makes you store a ton of different copies in your cache due to
the variety in user-agents.

-- 
Eric Covener
covener@gmail.com