Re: [MP2] How to turn off caching?

[prev] [thread] [next] [Date index for 2005/05/31]

From: Torsten Foertsch
Subject: Re: [MP2] How to turn off caching?
Date: 09:31 on 31 May 2005
--nextPart7662868.muJ3xJYRSE
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tuesday 31 May 2005 06:23, Foo Ji-Haw wrote:
> If I am not mistaken, modperl tends to cache all output until the script
> is completed, then it sends out the page. If I want to (for example)
> print a period (.) back to the browser every second, what do I need to
> do? I tried $| but it does not work.

My handler looks this:

package My::Content;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile=>qw(OK);

sub handler {
  my $r=shift;
  $r->content_type( 'text/html' );

  for( my $i=0; $i<10; $i++ ) {
    $r->print( time."\n" );
    $r->rflush;
    sleep 1;
  }
  $r->print( "\n" );
  return Apache2::Const::OK;
}

and here is what it sends every second one line as expected:

r2@opi:~> telnet localhost 8081
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /mp2-handler HTTP/1.0

HTTP/1.1 200 OK
Date: Tue, 31 May 2005 09:24:41 GMT
Server: Apache/2.0.54 (Unix) mod_perl/2.0.0 Perl/v5.8.5
Connection: close
Content-Type: text/html

1117531481
1117531482
1117531483
1117531484
1117531485
1117531486
1117531487
1117531488
1117531489
1117531490

Connection closed by foreign host.

It work with simple dots as well.

Torsten

--nextPart7662868.muJ3xJYRSE
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBCnC7lwicyCTir8T4RAqlrAJ4zpRtteWUXJiAEQ8FfIOxspDHv5wCggCPd
zl/m3RwH3j0B57U0FyzRYgI=
=WGRb
-----END PGP SIGNATURE-----

--nextPart7662868.muJ3xJYRSE--

(message missing)

Apache2::Reload problems
Mark 06:42 on 25 May 2005

Re: Apache2::Reload problems
Stephane GUIBOUD-RIBAUD 06:48 on 25 May 2005

Re: Apache2::Reload problems
Mark 15:53 on 25 May 2005

Re: Apache2::Reload problems
Stas Bekman 17:37 on 25 May 2005

Should I use Package or Modual or what?
Luinrandir Insight 17:19 on 25 May 2005

Re: Should I use Package or Modual or what?
Perrin Harkins 17:16 on 25 May 2005

Re: Should I use Package or Modual or what?
Perrin Harkins 17:57 on 25 May 2005

a mystery.. need help
Luinrandir Insight 08:36 on 29 May 2005

[OT] Re: a mystery.. need help
Frank Maas 10:37 on 29 May 2005

Re: Apache2::Reload problems
Philippe M. Chiasson 09:24 on 25 May 2005

Re: Apache2::Reload problems
Mark 15:30 on 25 May 2005

Re: a mystery.. need help
David Dick 05:37 on 29 May 2005

Re: a mystery.. need help
Luinrandir Insight 02:10 on 30 May 2005

Re: a mystery.. need help
Tom Schindl 07:55 on 30 May 2005

Re: a mystery.. need help
jonathan vanasco 16:23 on 30 May 2005

Re: a mystery.. need help
Luinrandir Insight 20:15 on 30 May 2005

[MP2] How to turn off caching?
Foo Ji-Haw 04:23 on 31 May 2005

Re: [MP2] How to turn off caching?
Rodger Castle 05:11 on 31 May 2005

Re: [MP2] How to turn off caching?
Foo Ji-Haw 07:45 on 31 May 2005

Re: [MP2] How to turn off caching?
Torsten Foertsch 09:31 on 31 May 2005

Re: [MP2] How to turn off caching?
Issac Goldstand 08:50 on 31 May 2005

Generated at 20:12 on 05 Jun 2005 by mariachi v0.52