pombreda / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

Being able to set "cache-control: no-cache" #224

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am fetching a feed server via Apache+SQUID, and feedparser is taking a WHILE 
to notice updates in the feed. Debugging the issue, I see that feedparser is 
getting the squid cached version of the feed.

feedparser should provide ways to interact with caches, like "cache-control" 
headers. The most obvious way is to add an optional "headers" dictionary to 
"parse", so the programmer can set any header she needs.

Original issue reported on code.google.com by j...@jcea.es on 5 Aug 2010 at 2:10

GoogleCodeExporter commented 9 years ago
The parse() function already takes an etag and a modified date. Adding a 
headers dictionary as a another argument would be a very useful addition.

The following patches don't quite do it in quite the right way:
http://code.google.com/p/feedparser/issues/detail?id=133
http://code.google.com/p/feedparser/issues/detail?id=163

They don't have tests and they don't deal with situations where etag or 
modified date or agent or referrer is also passed in to the dictionary. They 
also don't update the documentation.

Please send a patch. 

Original comment by a...@google.com on 7 Aug 2010 at 12:26

GoogleCodeExporter commented 9 years ago
I'd like to finish this off.  I'm having some trouble working out how to 
integrate this with the existing tests, because there does not seem to be any 
framework for testing different arguments to feedparser.parse.  Perhaps I'll 
add a new type of test that works at the api level rather than just against a 
canned response.

Original comment by martinp...@gmail.com on 2 Sep 2010 at 4:47

GoogleCodeExporter commented 9 years ago
The behaviour of the patch in bug #163 is that any headers explicitly specified 
will override the ones generated by feedparser itself.  To me that seems pretty 
reasonable.  I don't know why you'd pass Etag if you didn't want it to be used.

Code is in https://bazaar.launchpad.net/~mbp/feedparser/224-headers and the 
proposed documentation is under 
http://sourcefrog.net/tmp/1y/feedparser-226-docs/docs/http.html

Feedback welcome.

I guess this also needs to go into the news file but I'll leave that til we 
know it will actually go into a release.

Original comment by martinp...@gmail.com on 2 Sep 2010 at 5:53

Attachments:

GoogleCodeExporter commented 9 years ago
any chance of a review?

Original comment by martinp...@gmail.com on 15 Oct 2010 at 2:57

GoogleCodeExporter commented 9 years ago
Reviewed and committed in: 
http://code.google.com/p/feedparser/source/detail?r=316
Sorry for the delay.

Original comment by adewale on 15 Oct 2010 at 6:03

GoogleCodeExporter commented 9 years ago
Thanks very much!

Original comment by martinp...@gmail.com on 15 Oct 2010 at 6:05

GoogleCodeExporter commented 9 years ago
So, when can we have a release with this new feature?.

Original comment by j...@jcea.es on 18 Oct 2010 at 12:54

GoogleCodeExporter commented 9 years ago
There's still quite a few bugs to fix before I can do a release. In the 
meantime you should just grab the code from Subversion.

Original comment by adewale on 18 Oct 2010 at 1:09