Re: AxKit & Last-Modified header

2001-09-12 Thread Brian Wheeler

On Wed, 2001-09-12 at 19:34, J. Zobel wrote:
> On Mon, 2001-09-10 at 16:19, Brian Wheeler wrote:
> 
> > The only difference between the two (request-wise) is that static pages
> > return a "Last-Modified" header and dynamic data doesn't.  It seems to
> > me that if I drop that header, everything will work :)
> > 
> > I've tried doing:
> > 
> > $r->header_out("Last-Modified"=>'');
> > and
> > $r->header_out("Last-Modified"=>undef);
> > 
> > but the header still comes out.
> > 
> > Thoughts?  Am I on the right track?
> 
> Do not remove Last-Modified.
> Add an Expires (Maybe even 1970).
> 
> If the page is expired, the browser will rerequest it with an
> If-Modified-Since. So you can still play the 304 game.
> 
> Hth,
> Joachim
> 


Wait...maybe it did work. :)  I think my 'log out' procedure is broken,
but it works ok for the 'log in' part :)

Thanks!
Brian





Re: AxKit & Last-Modified header

2001-09-12 Thread Brian Wheeler

On Wed, 2001-09-12 at 19:34, J. Zobel wrote:
> On Mon, 2001-09-10 at 16:19, Brian Wheeler wrote:
> 
> > The only difference between the two (request-wise) is that static pages
> > return a "Last-Modified" header and dynamic data doesn't.  It seems to
> > me that if I drop that header, everything will work :)
> > 
> > I've tried doing:
> > 
> > $r->header_out("Last-Modified"=>'');
> > and
> > $r->header_out("Last-Modified"=>undef);
> > 
> > but the header still comes out.
> > 
> > Thoughts?  Am I on the right track?
> 
> Do not remove Last-Modified.
> Add an Expires (Maybe even 1970).
> 
> If the page is expired, the browser will rerequest it with an
> If-Modified-Since. So you can still play the 304 game.
> 
> Hth,
> Joachim
> 


No such luck...the browser continues to use the cached copy.

Brian




Re: AxKit & Last-Modified header

2001-09-12 Thread J. Zobel

On Mon, 2001-09-10 at 16:19, Brian Wheeler wrote:

> The only difference between the two (request-wise) is that static pages
> return a "Last-Modified" header and dynamic data doesn't.  It seems to
> me that if I drop that header, everything will work :)
> 
> I've tried doing:
> 
> $r->header_out("Last-Modified"=>'');
> and
> $r->header_out("Last-Modified"=>undef);
> 
> but the header still comes out.
> 
> Thoughts?  Am I on the right track?

Do not remove Last-Modified.
Add an Expires (Maybe even 1970).

If the page is expired, the browser will rerequest it with an
If-Modified-Since. So you can still play the 304 game.

Hth,
Joachim





Re: AxKit & Last-Modified header

2001-09-11 Thread Robin Berjon

On Tuesday 11 September 2001 16:01, Brian Wheeler wrote:
> On Tue, 2001-09-11 at 06:41, Matt Sergeant wrote:
> > You could always add in a blank AxOutputTransformer, which will force
> > AxKit to just use print(), even for cached content.
>
> I don't see AxOutputTransformer in the docs...do you have an example
> which would do this?
>
> (the $r->headers_out->unset didn't work)

Off the top of my head:

package MyDeleteLMod;

sub del {
Apache->request->headers_out('do whatever'); # not sure this is needed
    return @_;
}
1;

then in httpd.conf:

PerlModule MyDeleteLMod
AxAddOutputTransformer MyDeleteLMod::del

I'm not sure you need to actually munge the headers if you do that or if 
it'll influence AxKit's caching by itself (it always runs after caching).

-- 
___
Robin Berjon <[EMAIL PROTECTED]> -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
---
Smoking is one of the leading causes of statistics.




RE: AxKit & Last-Modified header

2001-09-11 Thread Brian Wheeler

On Tue, 2001-09-11 at 06:41, Matt Sergeant wrote:
> > -Original Message-
> > From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> > 
> > > -Original Message-
> > > From: Matt Sergeant [mailto:[EMAIL PROTECTED]]
> > > 
> > > > -Original Message-
> > > > From: Brian Wheeler [mailto:[EMAIL PROTECTED]]
> > > > 
> > > > $r->header_out("Last-Modified"=>'');
> > > > and
> > > > $r->header_out("Last-Modified"=>undef);
> > > > 
> > > > but the header still comes out.
> > > > 
> > > > Thoughts?  Am I on the right track?
> > > 
> > > Maybe:
> > > 
> > >   $r->headers_out->unset('Last-Modified');
> > 
> > hmmm, I don't know the AxKit architecture really, but I don't 
> > think you can
> > get rid of the Last-Modified header when using 
> > default-handler since it
> > calls set_last_modified() explicitly. IIRC AxKit uses the 
> > default-handler as
> > its caching engine, right?
> 
> "It depends" :-)
> 
> But yes, you might be right, depending on how the content gets delivered.
> 
> You could always add in a blank AxOutputTransformer, which will force AxKit
> to just use print(), even for cached content.
> 
> Matt.
> 

I don't see AxOutputTransformer in the docs...do you have an example
which would do this?

(the $r->headers_out->unset didn't work)


Thanks!
Brian




> 
> This email has been scanned for all viruses by the Star Internet Virus Screen.
> The service is provided in partnership with MessageLabs, the email security company.
> For more information on a higher level of virus protection visit www.star.net.uk
> 





RE: AxKit & Last-Modified header

2001-09-11 Thread Matt Sergeant

> -Original Message-
> From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> 
> > -Original Message-
> > From: Matt Sergeant [mailto:[EMAIL PROTECTED]]
> > 
> > > -Original Message-
> > > From: Brian Wheeler [mailto:[EMAIL PROTECTED]]
> > > 
> > > $r->header_out("Last-Modified"=>'');
> > > and
> > > $r->header_out("Last-Modified"=>undef);
> > > 
> > > but the header still comes out.
> > > 
> > > Thoughts?  Am I on the right track?
> > 
> > Maybe:
> > 
> >   $r->headers_out->unset('Last-Modified');
> 
> hmmm, I don't know the AxKit architecture really, but I don't 
> think you can
> get rid of the Last-Modified header when using 
> default-handler since it
> calls set_last_modified() explicitly. IIRC AxKit uses the 
> default-handler as
> its caching engine, right?

"It depends" :-)

But yes, you might be right, depending on how the content gets delivered.

You could always add in a blank AxOutputTransformer, which will force AxKit
to just use print(), even for cached content.

Matt.


This email has been scanned for all viruses by the Star Internet Virus Screen.
The service is provided in partnership with MessageLabs, the email security company.
For more information on a higher level of virus protection visit www.star.net.uk




RE: AxKit & Last-Modified header

2001-09-11 Thread Geoffrey Young



> -Original Message-
> From: Matt Sergeant [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 11, 2001 5:36 AM
> To: 'Brian Wheeler'; [EMAIL PROTECTED]
> Subject: RE: AxKit & Last-Modified header
> 
> 
> > -Original Message-
> > From: Brian Wheeler [mailto:[EMAIL PROTECTED]]
> > 
> > $r->header_out("Last-Modified"=>'');
> > and
> > $r->header_out("Last-Modified"=>undef);
> > 
> > but the header still comes out.
> > 
> > Thoughts?  Am I on the right track?
> 
> Maybe:
> 
>   $r->headers_out->unset('Last-Modified');

hmmm, I don't know the AxKit architecture really, but I don't think you can
get rid of the Last-Modified header when using default-handler since it
calls set_last_modified() explicitly. IIRC AxKit uses the default-handler as
its caching engine, right?

if that's true, you might want to try fiddling with mod_expires and see if
you can get the results you want from it.

from mod_perl you might be able to enforce a stale page by setting
$r->mtime(0) before the Apache default content handler runs, which ought to
result in a Last-Modified header of Jan 1, 1970 (untested, but I'm pretty
sure I tried it once)

HTH

--Geoff



RE: AxKit & Last-Modified header

2001-09-11 Thread Matt Sergeant

> -Original Message-
> From: Brian Wheeler [mailto:[EMAIL PROTECTED]]
> 
> $r->header_out("Last-Modified"=>'');
> and
> $r->header_out("Last-Modified"=>undef);
> 
> but the header still comes out.
> 
> Thoughts?  Am I on the right track?

Maybe:

  $r->headers_out->unset('Last-Modified');

Matt.


This email has been scanned for all viruses by the Star Internet Virus Screen.
The service is provided in partnership with MessageLabs, the email security company.
For more information on a higher level of virus protection visit www.star.net.uk