Mailing List Archive

SSI flastmod substitute
Hi all,

I want to display the last modification date of the main script
aka HTML page like the SSI command flastmod.
My solution so far is:
[-
use Time::gmtime;
use File::stat;
-]

Last modified: [+ localtime(stat($req_rec->filename())->mtime); +]
or
Last modified: [+ localtime(stat($0)->mtime); +]
or
Last modified: localtime(stat($ENV{PATH_TRANSLATED})->mtime); +]

My questions:
1. Is there a shorter, more elegant way? Perhaps in one line?
2. Apache did load the script file before. Does the Apache
request object remember the mtime of the script file?
3. Is it better to chain Apache::SSI with Embperl?

I don't like a second stat of every HTML-file regarding
server performance.
--
Frerk Meyer mailto:fm@channel-one.de
Channel.One http://www.channel-one.de
RE: SSI flastmod substitute [ In reply to ]
> I want to display the last modification date of the main script
> aka HTML page like the SSI command flastmod.

> My questions:
> 1. Is there a shorter, more elegant way? Perhaps in one line?
> 2. Apache did load the script file before. Does the Apache
> request object remember the mtime of the script file?

Last modified: [+ localtime(($req_rec->finfo)[9]); +]

uses the mtime saved by Apache

> 3. Is it better to chain Apache::SSI with Embperl?
>

No, this will definitivly a great loss in performance

Gerald