Re: mod_rewrite: time of last modification?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/03/07, rihad <rihad@xxxxxxx> wrote:
Hi, I was wondering if it was possible to use the file's modification
time (mtime) as a rewrite condition? For example, this is a howto
snippet presented at
<http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html>:

RewriteCond %{REQUEST_FILENAME}   !-s
RewriteRule ^page\.html$          page.cgi   [T=application/x-httpd-cgi,L]

Here a request to page.html leads to a internal run of a corresponding
page.cgi if page.html is still missing or has filesize null.


I'm no Unix guru, but is it true that stat() has already been done on
page.cgi to determine its size with -s? Then I'm guessing it would be
pretty trivial to use or implement the mtime along the same lines (like
"if file on disk is older than 30 minutes, then make this a CGI request
transparently"). This would be plain awesome!

Thanks in advance.

That sounds like it could be pretty neat. On the other hand using http
caching you can achieve almost the same effect. Make your script issue
a ttl (Expires: header) and then stick mod_cache in front of it. The
only difference I guess is the first request.

See here for the most pimped caching docs on the internets:
http://www.mnot.net/cache_docs/

--
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux