httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nik600 <nik...@gmail.com>
Subject Re: is ap_hook_log_transaction the wright place where to write my stats code ?
Date Sun, 07 Dec 2014 10:29:19 GMT
Thanka for your reply!

Is not so simple...the custom logic is a mixture of regex, memcached get,
json, cookies and http headers so i had to write a custom module.

Btw, thanks for your help!
Il 07/dic/2014 10:25 "Sorin Manolache" <sorinm@gmail.com> ha scritto:

> On 2014-12-07 01:36, nik600 wrote:
>
>> Dear all
>>
>> i've written a custom module to handle the cache of my CMS system.
>>
>> Basically this module works in ap_hook_translate_name and decides
>> (following some custom logic) if the request can be served or not from the
>> cache.
>>
>> If yes, the r->uri is changed to be served locally from my cache dir
>> if no, the r->filename is changed to be server from
>> a proxy:balancer://cluster config
>>
>> In the ap_hook_log_transaction i'd like to compute the time of content
>> generation using:
>>
>>  float request_duration_sec=(float)(apr_time_now() -
>>>
>> r->request_time)/1000000;
>>
>> Is this approach correct?
>>
>> Is there any other hook more appropriate to do that?
>>
>> Thanks all in advance.
>>
>
> Hello,
>
> I think your approach is correct. However, have a look at the LogFormat
> directive. The %D directive might do exactly what you want and implemented
> in log_transaction.
>
> Have a look at the RewriteCond and RewriteRule directives. The selective
> proxying could be implemented by these directives without writing any code.
>
> E.g.:
>
> <LocationMatch ^/your_url_pattern>
>     RewriteEngine On
>     RewriteCond ...
>     RewriteCond ...
>     RewriteRule .*  http://proxy/path?args keepalive=on [P]
> </LocationMatch>
>
> <Proxy http://proxy/path>
>     ...
> </Proxy>
>
> I have not tried it with balancers but I think it works and the
> configuration is similar (balancer:// instead of http://).
>
> Sorin
>
>
>> Bye
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message