I've recently been debugging a problem with an application that parses RSS feeds, and encountered some behaviour in a third-party RSS feed which seems rather odd to me. I would be interested in knowing whether this behaviour is legitimate (per the HTTP RFCs), or even widespread, and also whether it's regarded as good practice.
When I do the following HTTP request to the RSS feed URL, I always get an RSS 2.0 feed with 20 items.
GET /news.rss HTTP/1.1
Host: thesite.com
However, if I do the following conditional GET request using the If-Modified-Since
header, I get a smaller RSS file with fewer than 20 items – just those with an RSS <pubDate>
equal or after the If-Modified-Since
header.
GET /news.rss HTTP/1.1
Host: thesite.com
If-Modified-Since: Mon, 10 Feb 2025 00:00:00 GMT
The parser I'm debugging makes the assumption that the conditional GET request will either return the full set of 20 items, or else will return a 304 Not Modified. At some level, I need to fix the parser as it's an unnecessary assumption and the RSS feed is not under my control, but it would be useful to know whether this behaviour is legal.
The nearest I can find is §13.1.3 of RFC 9110 which says:
An origin server that evaluates an If-Modified-Since condition SHOULD NOT perform the requested method if the condition evaluates to false; instead, the origin server SHOULD generate a 304 (Not Modified) response, including only those metadata that are useful for identifying or updating a previously cached response.
That's not as clear as I might like – perhaps intentionally – but seems to imply the request will either return the same data as an unconditional request, or else return a 304. Unsurprisingly, the RSS 2.0 spec has nothing to say on the subject.
Outside of RSS, I've seen it once or twice in the REST APIs for a piece of accounting software, but not more widely. Is it good practice for an HTTP server to handle conditional requests in this way?
ETag
s rather thanLast-Modified
is suggested at intertwingly.net/blog/2004/09/11/Vary-ETag . I do not believe either went further in terms of standardisation.