-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: store HTTP last modified date from response header #2724
fix: store HTTP last modified date from response header #2724
Conversation
Hey, I think this: news/lib/Fetcher/FeedFetcher.php Lines 506 to 509 in caaace3
can be removed then otherwise it would set the date first and then the new logic would overwrite the field again. |
c765583
to
3fad2bd
Compare
Apologies for the delayed response. Been on vacation and still catching up on things. Appreciate your feedback that that line isn't needed. |
Signed-off-by: Ben Vidulich <ben@vidulich.nz>
Signed-off-by: Ben Vidulich <ben@vidulich.nz>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
e5a08d5
to
d9845fe
Compare
Confirming this issue is fixed, user was requesting feeds from my apache server and was previously pulling a new feed every request, now they're getting 304 unless there's something new to get. 🎉 They were on alpha08 before, now alpha11. Had to get in touch to find out the old version, very glad the new one updates the user-agent too. |
This addresses a scenario where a server providing a feed responds with a
Last-Modified
header that is derived from a file modification time. A static site generator, for example, may re-create a feed file without making changes to the file contents - in particular thepubDate
for any feed items. Now the mtime andLast-Modified
header have a date that is newer than anypubDate
elements.If News sends a request with a
If-Modified-Since
header based on the olderpubDate
then the server will respond with 200 and send the entire feed file contents even though the feed has not logically changed. To minimise server bandwidth, ideally News sends a last modified date based on theLast-Modified
header it received during the last fetch so that the server can respond with 304.Summary
Last-Modified
header is present store the value from the header.Checklist