Re: remote file time -small issue
| From: | Richard Lynch | Date: | Fri, 23 Feb 2007 21:16:22 +0000 |
| Subject: | Re: remote file time -small issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249327@lists.php.net to get a copy of this message | ||
On Thu, February 22, 2007 2:34 am, SJAMHO DBMS wrote:
> I have a problem with the attached file.
> Run it or see it here: http://www.sjamho.com/update/remote.php
>
> The issue is: the timestamps are shown for every file in a
> subdirectory, but
> never for a file in the root of a domain.
> Can anyone tell me why?
Yes.
The URLs in question don't provide a Last-modified: header.
localhost junk # wget --server-response
http://www.pitpass.com/forum/viewforum.php
| head -n 40
--15:10:58-- http://www.pitpass.com/forum/viewforum.php
=> `viewforum.php'
Resolving www.pitpass.com... 64.62.155.120
Connecting to www.pitpass.com|64.62.155.120|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Fri, 23 Feb 2007 21:11:52 GMT
Server: Apache/1.3.34 (Unix) PHP/4.4.2
X-Powered-By: PHP/4.4.2
Set-Cookie:
forum_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3A-1%3B%7D;
expires=Sat, 23 Feb 2008 21:11:52 GMT; path=/forum/;
domain=pitpass.com
Set-Cookie: forum_sid=f5caf540f60eb89ce67a0672d7bffef7;
path=/forum/; domain=pitpass.com
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Expires: 0
Pragma: no-cache
Content-Type: text/html
X-Cache: MISS from www.pitpass.com
Connection: close
Length: unspecified [text/html]
Excellent question, by the way!
I believe that if Last-modified is not provided, you can safely assume
that the page is dynamic, or should be treated as such -- I.e., the
page will be different every time you view it, in theory.
Unless you are pounding the same page more than once per second, you
could probably just store time() as the Last-modified in that case,
and move on with life.
Or you could leave it as 0 and know that that means that the page had
no Last-modified header.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?