Re: remote file time -small issue

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

 



You can always add a header to your own PHP scripts if you want to
maintain that info -- but be aware that you really need to be careful
to change it if you expect browsers to get the LATEST version of your
data.

http://php.net/header

You will find, however, that MANY script-driven websites (PHP, ASP,
Perl/cgi, JSP, whatever) are simply not going to provide a
Last-Modified header, and you're going to have to do something
reasonable for your needs in that case.

Be very careful -- The pros writing actual browsers like Netscape,
Mozilla and IE (well, okay, maybe "pro" is to strong in one of
those... ended up getting "bit" several times by not really thinking
through what happens with Last-Modified and various wrinkles,
including caching and daylight savings time changes.

I'm sure there are other issues...

Nothing seems so simple, but turns out to be so complex, as Time.

After years of programming, I'm now just plain amazed that humans can
even make any sense at all of the current "system" of date/time in
use.

I know for damn sure the computers won't ever be able to get it right.

On Fri, February 23, 2007 6:10 pm, SJAMHO DBMS wrote:
> Thanks Richard,
>
>
> I was afraid that there would be no other way... By the way: root
> documents
> (like http://sjamho.com/index.php) also do not have this
> date_last_modified... seems to be ebcause of the headers issue..
>
>
> Thanks again :-) Regards, Jos
>
> On 2/24/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
>>
>> 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?
>>
>>
>
>
> --
>
>
>
> Kind Regards,
> MacJos EnterPrises (S) Pte. Ltd.
> Jos Janssen, Chief Executive Officer
>
> http: www.macjos.com  / e-Mail: jos@xxxxxxxxxx / e-Fax: (1) 707 370
> 9299
> Telephone: Singapore - (65) 9775 5320 / Indonesia - (62) 856 5840 8664
>
> _________________________________________________________
>
> CONFIDENTIALITY STATEMENT:
> Unless stated to be non-confidential, this email and any
> attachments are private and confidential and are for the
> addressee only. If you have received this email in error
> please telephone us on receipt. You are strictly prohibited
> from using, copying or disseminating it or any information
> contained in it save to the intended recipient. Internet
> communications are not secure and MacJos EnterPrises (S)
> Pte. Ltd. is not responsible for their abuse by third
> parties, nor for any alteration or corruption in transmission.
> _________________________________________________________
>


-- 
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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux