[Twisted-web] adding etag and modified arguments to
twisted feedparser
Selwyn McCracken
selwyn.mccracken at stonebow.otago.ac.nz
Wed Sep 29 03:45:58 MDT 2004
Hi Valentino,
sorry for bugging you again.
I have had a look through httpcache.py, but as a total newcomer to
twisted I am slightly overwhelmed by the concepts of factories and
protocols at this stage.
I tried modifying getPage() from your recipe to include httpcache, so
that I could see what was happening, like so:
def getPage(self, data, args):
return httpcache.getPageCached(args,timeout=TIMEOUT)
however this triggers the following error:
"global name '_parse' is not defined", and I'm not sure how to proceed.
In any case, what I would ideally like is something like:
def getPage(self, data, args):
return httpcache.getPageCached(args,timeout=TIMEOUT,
etag=_ETAG,modified=_MODIFIED)
This would simply return the page in full or the 304 error, and then I
can handle the caching and timestamping outside in workOnPage().
Any help once again would be greatfully received.
thanks,
Selwyn
More information about the Twisted-web
mailing list