A
Ajay
hi!
i am reading a file on the Web. How can i find out when it was last
modified?
thanks
i am reading a file on the Web. How can i find out when it was last
modified?
thanks
That would be the "Last-Modified" HTTP header, when it's present.Ajay said:hi!
i am reading a file on the Web. How can i find out when it was last
modified?
thanks
Quoting Steve Holden said:That would be the "Last-Modified" HTTP header, when it's present.Ajay said:hi!
i am reading a file on the Web. How can i find out when it was last
modified?
thanks
Python 2.3.4 (#1, Jun 13 2004, 11:21:03)
[GCC 3.3.1 (cygming special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.Server: Microsoft-IIS/5.0
Date: Tue, 28 Sep 2004 01:50:38 GMT
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Wed, 25 Aug 2004 17:47:51 GMT
ETag: "242599a4cb8ac41:f460"
Content-Length: 12456
Oops, time I reinstalled the auto-update code to keep my Python links
fresh!
Ajay said:is it possible for someone to change the Last-Modified header? Can someone
put a new updated document, but in such a way that if someone requests
that document, they get an old date rather than the new date?
i can see a CGI script add its own header and then write out the document.
but can this be done with a simple HTML page?
Quoting Peter Hansen said:Certainly... the server can do anything it wants with that
header, including failing to provide it, providing an invalid
date, providing a date in the future or distant past, or
even providing a date that happens to correspond exactly
with the true "last modified" date of the document...
Whether a *particular* server will do that with a *particular*
kind of document is a different question altogether.
Do you have a specific situation involving this that you
can describe, or are you just asking in general, out of
curiosity?
Compare the MD5 checksums instead. Python has an MD5 function, somewhere ...Ajay said:thanks
it was mostly out of curiousity. I have an interchange where the servers
would send a policy and request a resource. the other server would
evaluate the policy and respond accordingly.
i am hoping to cut down on the evaluation by maintaining a record of past
transactions and if everything is the same (policy, resource ets) then
take the same action as before. one way was to store policy used earlier
and compare that with the new one and so on. since the app is for a mobile
device with low processing power, i was hoping to perhaps use modified date
- which when i thought a little more about it is clearly not feasible.
i guess comparing two really large strings is what i'll have to go with.
any ideas on performance of string comparisons?
thanks
it was mostly out of curiousity. I have an interchange where the servers
would send a policy and request a resource. the other server would
evaluate the policy and respond accordingly.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.