You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Karim Zaki <Ka...@itworx.com> on 2009/01/14 13:41:10 UTC

[users@httpd] Processing mod_cache after mod_rewrite

All,

I need to have mod_cache process requests after mod_rewrite is done with them. The reason I need this is that CacheEnable only accepts a path and will cache everything under that path, while I need to cache based on more granular criteria...so I need mod_rewrite to look at the request and modify it, and then mod_cache to see the modified URI and act accordingly. mod_cache should not cache any request that's been modified by mod_rewrite, since it would no longer fall under the cacheable path. However, what happens is that mod_rewrite modifies the URI, but mod_cache still sees the original URI.

I googled and found  two old threads from 2005 and 2007 discussing mod_cache being a "quick" handler and citing this as the reason for this behavior. Is there any way around it?

Regards,
Karim

-------------------------------------------------------------------------------
"Although the moon is smaller than the earth, it is farther away."


---------------------------------------------------------------------
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] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
I checked the event logs and found that it's looking for .net framework DLLs and not finding them..

Event Type:     Error
Event Source:   SideBySide
Event Category: None
Event ID:       32
Date:           1/18/2009
Time:           5:47:36 AM
User:           N/A
Computer:       XITXW01
Description:
Dependent Assembly Microsoft.VC90.CRT could not be found and Last Error was The referenced assembly is not installed on your system.


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Any idea if I can avoid installing the .net framework? Does mod_cache doesn't require it, so why is it asking for it now?

Thanks,
Karim

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Thursday, January 15, 2009 7:50 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Thu, Jan 15, 2009 at 11:49 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Unfortunately
>
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Thursday, January 15, 2009 6:46 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite
>
> On Thu, Jan 15, 2009 at 11:43 AM, Karim Zaki <Ka...@itworx.com> wrote:
>> Eric,
>>
>> I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.
>


anything in the error log or event viewer?


--
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] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Update:

It worked. I had to install the Microsoft Visual C++ 2008 redistributable package on the server running the newly compiled mod. Now when I set no-cache to 1 using mod_rewrite, the URL doesn't get cached. That's a great addition to the flexibility of Apache. I love it.

Thanks for your help, Eric.

-----Original Message-----
From: Karim Zaki
Sent: Sunday, January 18, 2009 12:02 PM
To: 'users@httpd.apache.org'
Subject: RE: [users@httpd] Processing mod_cache after mod_rewrite

I checked the event logs and found that it's looking for .net framework DLLs and not finding them..

Event Type:     Error
Event Source:   SideBySide
Event Category: None
Event ID:       32
Date:           1/18/2009
Time:           5:47:36 AM
User:           N/A
Computer:       XITXW01
Description:
Dependent Assembly Microsoft.VC90.CRT could not be found and Last Error was The referenced assembly is not installed on your system.


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Any idea if I can avoid installing the .net framework? Does mod_cache doesn't require it, so why is it asking for it now?

Thanks,
Karim

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Thursday, January 15, 2009 7:50 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Thu, Jan 15, 2009 at 11:49 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Unfortunately
>
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Thursday, January 15, 2009 6:46 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite
>
> On Thu, Jan 15, 2009 at 11:43 AM, Karim Zaki <Ka...@itworx.com> wrote:
>> Eric,
>>
>> I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.
>


anything in the error log or event viewer?


--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Thu, Jan 15, 2009 at 11:49 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Unfortunately
>
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: Thursday, January 15, 2009 6:46 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite
>
> On Thu, Jan 15, 2009 at 11:43 AM, Karim Zaki <Ka...@itworx.com> wrote:
>> Eric,
>>
>> I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.
>


anything in the error log or event viewer?


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


RE: [users@httpd] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Unfortunately

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Thursday, January 15, 2009 6:46 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Thu, Jan 15, 2009 at 11:43 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Eric,
>
> I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.

Nope. Are you on windows?

--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Thu, Jan 15, 2009 at 11:43 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Eric,
>
> I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.

Nope. Are you on windows?

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


RE: [users@httpd] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Eric,

I downloaded 2.2.11, applied the patch, and re-built mod_cache. It succeeded and generated mod_cache.so. However, after replacing mod_cache.so with the updated one on my server, Apache refused to start. The message just says "The requested operation has failed!" and the log is empty. Even after commenting the LoadModule directive, it still fails to start.

An ideas why this might be happening?

Thanks,
Karim

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Wednesday, January 14, 2009 7:45 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Wed, Jan 14, 2009 at 10:47 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Sounds interesting. Do you know where I can get a build that I can expect to successfully compile?

easiest way would be to download 2.2.11 and then apply the trivial patch here:

http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c?r1=727599&r2=733762&view=patch

--
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] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Thanks. I'll give it a shot.
________________________________________
From: Eric Covener [covener@gmail.com]
Sent: Wednesday, January 14, 2009 19:44
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Wed, Jan 14, 2009 at 10:47 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Sounds interesting. Do you know where I can get a build that I can expect to successfully compile?

easiest way would be to download 2.2.11 and then apply the trivial patch here:

http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c?r1=727599&r2=733762&view=patch

--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jan 14, 2009 at 10:47 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Sounds interesting. Do you know where I can get a build that I can expect to successfully compile?

easiest way would be to download 2.2.11 and then apply the trivial patch here:

http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c?r1=727599&r2=733762&view=patch

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


RE: [users@httpd] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Sounds interesting. Do you know where I can get a build that I can expect to successfully compile?

Thanks again.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Wednesday, January 14, 2009 5:42 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Wed, Jan 14, 2009 at 10:15 AM, Karim Zaki <Ka...@itworx.com> wrote:
> But if I stuck with rewrite, mod_cache would still process before rewrite, and so this solution would not work.

I think he'll decide to try to save it, but there are checks during
this very late saving that offer a chance to bail out (like the new
envvar).

Some of this stuff, based on the content/headers of the response, is
obviously not available in the early stage of processing.


--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jan 14, 2009 at 10:15 AM, Karim Zaki <Ka...@itworx.com> wrote:
> But if I stuck with rewrite, mod_cache would still process before rewrite, and so this solution would not work.

I think he'll decide to try to save it, but there are checks during
this very late saving that offer a chance to bail out (like the new
envvar).

Some of this stuff, based on the content/headers of the response, is
obviously not available in the early stage of processing.


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


RE: [users@httpd] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
But if I stuck with rewrite, mod_cache would still process before rewrite, and so this solution would not work.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: Wednesday, January 14, 2009 4:49 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Wed, Jan 14, 2009 at 9:36 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Hi Eric,
>
> Thanks for the insight. Do you mean that I should set it using SetEnvIf, or did you have something else in mind?

The advice below would be if you stuck with rewrite, the E flag.  But
if you didn't need to change the URL outside of the CacheRoot, you
probably wouldn't be using mod_rewrite anymore.


--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jan 14, 2009 at 9:36 AM, Karim Zaki <Ka...@itworx.com> wrote:
> Hi Eric,
>
> Thanks for the insight. Do you mean that I should set it using SetEnvIf, or did you have something else in mind?

The advice below would be if you stuck with rewrite, the E flag.  But
if you didn't need to change the URL outside of the CacheRoot, you
probably wouldn't be using mod_rewrite anymore.


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


RE: [users@httpd] Processing mod_cache after mod_rewrite

Posted by Karim Zaki <Ka...@itworx.com>.
Hi Eric,

Thanks for the insight. Do you mean that I should set it using SetEnvIf, or did you have something else in mind?

Regards,
Karim
________________________________________
From: Eric Covener [covener@gmail.com]
Sent: Wednesday, January 14, 2009 16:00
To: users@httpd.apache.org
Subject: Re: [users@httpd] Processing mod_cache after mod_rewrite

On Wed, Jan 14, 2009 at 7:41 AM, Karim Zaki <Ka...@itworx.com> wrote:
> All,
>
> I need to have mod_cache process requests after mod_rewrite is done with them. The reason I need this is that CacheEnable only accepts a path and will cache everything under that path, while I need to cache based on more granular criteria...so I need mod_rewrite to look at the request and modify it, and then mod_cache to see the modified URI and act accordingly. mod_cache should not cache any request that's been modified by mod_rewrite, since it would no longer fall under the cacheable path. However, what happens is that mod_rewrite modifies the URI, but mod_cache still sees the original URI.
>
> I googled and found  two old threads from 2005 and 2007 discussing mod_cache being a "quick" handler and citing this as the reason for this behavior. Is there any way around it?


The next 2.2.x release will allow you to do E=no-cache:1 to prevent a
response from being saved by mod_cache.

http://httpd.apache.org/docs/2.3/env.html

--
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] Processing mod_cache after mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jan 14, 2009 at 7:41 AM, Karim Zaki <Ka...@itworx.com> wrote:
> All,
>
> I need to have mod_cache process requests after mod_rewrite is done with them. The reason I need this is that CacheEnable only accepts a path and will cache everything under that path, while I need to cache based on more granular criteria...so I need mod_rewrite to look at the request and modify it, and then mod_cache to see the modified URI and act accordingly. mod_cache should not cache any request that's been modified by mod_rewrite, since it would no longer fall under the cacheable path. However, what happens is that mod_rewrite modifies the URI, but mod_cache still sees the original URI.
>
> I googled and found  two old threads from 2005 and 2007 discussing mod_cache being a "quick" handler and citing this as the reason for this behavior. Is there any way around it?


The next 2.2.x release will allow you to do E=no-cache:1 to prevent a
response from being saved by mod_cache.

http://httpd.apache.org/docs/2.3/env.html

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