Thanks Roman for your description. I have two annotations:

> If you have a simple Embperl page, the following code near the top of
> the page (after setting any headers, but before generating any HTML
output)
> will handle conditional requests
>
> [- # set modification date and handle conditional requests
>    $req_rec->update_mtime((stat _)[9]);
>
>    $req_rec->set_last_modified();
>    if ((my $rc = $req_rec->meets_conditions) != OK) { # we can give up
>          $req_rec->status($rc);
>          exit;
>    }
> -]
>
> (The _ file handle contains cashed stat() data for the requested file,
> per the eagle book)
>

That's true for a modperl handler, and it works for an Embperl page too but
this is chance...

It works because Embperl does a stat on the page, before it executes it, but
it is not guarantee to stay so in the future. Especialy for Embperl 2.0 I
have plans to move some of the startup code into C, because it takes a lot
of time for small pages and in this case _ will be undefined.

Fortunately I also have plans to build this sending of the last-modified
header and the 304 response directly into Embperl to integrate it well with
it's cache management.

>[..]
> The handler code for EmbperlObject puts the original file name requested
> into $req_rec->notes('EMBPERL_orgfilename'),

This is true for Embperl 1.3.0 but is only there for compatibility reasons.
Future version will include a documentation of the Embperl request object
and this object will have methods to retrive these filenames (actually they
are already there, but may be subject to change, so I don't like to publish
them here)

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to