finding time when url was modified

Steve Holden steve at holdenweb.com
Mon Sep 27 23:22:26 EDT 2004


Ajay wrote:

> Quoting Peter Hansen <peter at engcorp.com>:
> 
> 
>>Ajay wrote:
>>
>>>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?
>>
>>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?
> 
> 
> 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?
> 
Compare the MD5 checksums instead. Python has an MD5 function, somewhere ...

regards
  Steve



More information about the Python-list mailing list