perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Dunlap <j...@lariat.co>
Subject Re: no_cache(1)
Date Tue, 08 Sep 2015 16:05:39 GMT
I am going to echo Paul's comments. If you've used a print anywhere in your
code prior to invoking $r->no_cache(1); then it's not going to work because
sending of even a single byte of content will cause apache to send the
response headers and you are then unable to modify the response headers
once they have already been sent.

On Mon, Sep 7, 2015 at 4:51 PM, Paul Silevitch <paul@silevitch.com> wrote:

> Weird.
>
> Try the following instead:
>
> $r->headers_out->set('Pragma' => 'no-cache');
> $r->headers_out->set('Cache-Control' => 'no-cache');
>
> I've actually never used 'no_cache' before but instead used the above two
> lines.
>
> Let me know if it works for you.
>
> Thanks,
>
> Paul
>
> On Mon, Sep 7, 2015 at 4:39 PM, Michel Jansen <mailmaster@web-ict.com>
> wrote:
>
>>
>> Hi Paul,
>>
>> You wrote:
>>
>> Helle Michel,
>>
>> Are you calling $r->no_cache before any response data has been sent?
>>
>>
>> Yes. Before setting the content type to text/html.
>>
>> When you say the browser receives a '0' in the response, what do you mean
>> exactly?
>>
>>
>> My Ajax responder sends some fields separated by | which are being split
>> and then distributed into a page. The 0 is received by the JavaScript which
>> performes the Ajax request as first response and is then connected to the
>> first field.
>>
>> Do i make sense ?
>>
>>
>> Thanks,
>>
>> Paul
>>
>> On Mon, Sep 7, 2015 at 4:15 PM, Michel Jansen <Michel.Jansen@web-ict.com>
>> wrote:
>>
>>> if i add $r->no_cache(1) to an ajax responder perl script the browser
>>> receives a 0 in the response, what am i doing wrong?
>>>
>>>
>>> Regards,
>>>
>>> Michel
>>>
>>
>>
>


-- 
John Dunlap
*CTO | Lariat *

*Direct:*
*john@lariat.co <john@lariat.co>*

*Customer Service:*
877.268.6667
support@lariat.co

Mime
View raw message