Dear friends,
I have this code which attempts to get the last modified date of an http resource:
request = urllib2.Request('http://www.imdb.com')
>>> opener = urllib2.build_opener()
>>> request.headers
{}
>>> first = opener.open(request)
>>> first.headers.dict
{'transfer-encoding': 'chunked', 'set-cookie': 'session-id=209.251.138.146.1246519635845007; path=/; domain=.imdb.com, uu=bN4RO5T1YWqLBgRAupwcdgCRSyzj0j26pvJ+qYPCXqmT117Zs9L+/LfGO4zGx50bwJFtjNPSXuqj8g4pgDJ+meCRbaoGcS2aoNZb7PiBbbqjkm66I/I+qSAyfpnj8l7qA/I+qTAyfpngkW2KBnEtmqDXe20AkW26oLFtuqC3KyrjwW26o5IOuZOyLtnAgc0ZsLFtuqCRbergwR2Ko=;expires=Thu, 30 Dec 2037 00:00:00 GMT;path=/;domain=.imdb.com, cs=xOA2Pyx3xsSbt7wMU8ZOhAbGfbqgkW2NmIHl2qPyXuoj8j6pMDJ+meCRbYoGES2aoJFb/feFHbqjsg7/p9HNySCRWyxAGW26oKdbraCRbbqgsW26oJFt+uDBHYqg==;expires=Fri, 03 Jul 2009 07:00:00 GMT;path=/;domain=.imdb.com', 'vary': 'Accept-Encoding,User-Agent', 'server': 'Server', 'connection': 'close', 'cache-control': 'private', 'date': 'Thu, 02 Jul 2009 07:27:15 GMT', 'p3p': 'policyref="http://i.imdb.com/images/p3p.xml",CP="IMDB "', 'content-type': 'text/html'}
As you see in the server's response last-modified header is not set. In this circumstances, how to force the server to give data only if the cached page at user has been modified by the server instead of the server making every response refreshed.
Thanks