filter chain_link problem

Dennis J. dennisml at conversis.de
Wed Jan 13 06:47:52 MSK 2010


On 01/13/2010 04:05 AM, agentzh wrote:
> On Wed, Jan 13, 2010 at 10:17 AM, Dennis J.<dennisml at conversis.de>  wrote:
>>     ngx_buf_t                 *header_buffer;
>>     ngx_chain_t               *header_link;
>>
>>         header_buffer->pos = (u_char *) "<!-- Served by Nginx -->";
>>         header_buffer->last = header_buffer->pos + sizeof("<!-- Served by
>> Nginx -->") - 1;
>
> I haven't looked hard, but it seems that you didn't allocate the
> ngx_buf_t object under the header_buffer pointer?

Hm, thinking about it that should have been a problem.
Strangely enough things started working the moment I set 
header_buffer->memory=1. Strange.
Anyway I'm already at a point where I can insert a proper header from a 
file using ngx_open_cached_file().

What I noticed is that if I don't shift+reload I always get a 304 not 
modified. What is the proper way of disabling this caching in a filter so 
that the data sent is always fresh? I tried setting r->no_cache but I'm not 
even sure the filter function itself is the proper place to do that?

I also tried:

     tp = ngx_timeofday();
     r->headers_out.last_modified_time = tp->sec;

but that didn't work either.

Regards,
   Dennis



More information about the nginx mailing list