[whatwg/fetch] Proposal: add a boolean property `notModified` to `Response` (Issue #1440)

The currently `Response` has a `redirected` property to indicate redirections during the fetch call.

However, there is no way to check whether the server respond a `304 Not Modified` response. But why we need to check this status?

I am developing [WebFeed](https://github.com/taoso/webfeed), a lightweight web feed reader extension. In order to remind users there are new files published, WebFeed needs to check the subscribed feeds (RSS or Atom) periodically, by the fetch API. 

For most blog or website, it is seldomly to publish content very frequently. Daily or weekly is good, and monthly or even yearly is not rare. So if the server support conditional request, the most fetch request sent by WebFeed will receive a `304 Not Modified` response, which means there is nothing new.

Parse these XML feeds without small memory consumption is not a trival task. So I wish to avoid useless parsing procedure as mush as possible. If the server respond a 304 status, it indicates there is no change during last fetch. There is nothing to parse. So if the `Response` has a `notModified` property, WebFeed could notice that and do not parse the response body again.

I am not a browser engineer. But given the support of the `redirected` property, I do not think implementing this proposal is a hard task.

Please make your comments of this proposal. Thanks.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1440
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1440@github.com>

Received on Sunday, 15 May 2022 05:03:04 UTC