lenza.m...@gmail.com
unread,Mar 2, 2009, 6:47:58 PM3/2/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
My app needs to get a fresh copy of a dynamic webpage page every few
minutes. I am fetching date from a URL with this function:
def getUrlData(url):
result = urlfetch.fetch(url, headers = {'Cache-Control' : 'no-
cache', 'Pragma' : 'no-cache'})
if(result.status_code != 200):
logging.error( "Error getting URL data: %d" %
result.status_code)
return None
logging.warn("Fetch %s response headers: %s" % (url, repr
(result.headers)))
return result.content
However, it seems like I am still getting cached data. The logging
statement output the following:
Fetch [URL] response headers: {'Content-Length': '21883', 'X-Google-
Cache-Control': 'remote-cache-hit', 'Age': ' 633', 'Expires': 'Mon,
02 Mar 2009 23:49:23 GMT', 'Vary': 'Accept-Encoding', 'Server':
'Apache', 'last-modified': 'Mon, 02 Mar 2009 23:34:23 GMT',
'Connection': 'close', 'Via': 'HTTP/1.1 GWA (remote cache hit)',
'Cache-control': 'public; max-age=600', 'Date': 'Mon, 02 Mar 2009
23:34:23 GMT', 'Content-Type': 'text/html; charset=ISO-8859-1'}
Does anyone know how to ensure a fresh page?