One of the benefits we might get from the new architecture I'm testing is a much more integrated and simpler feed management, so while adapting the current code to the new class layout I took the occasion to revise or support for Conditional Get.
I had already adapted Simon Willison's code to work around a bug in PHP's
date
formats (fixed in 4.3.11), but the code was a bit too complex for my tastes, and re-reading the relevant parts of the HTTP/1.1 specification, I noticed that full compliance requires supporting three different date formats, all in GMT:
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() formatAll HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception.
HTTP/1.1 clients and servers that parse the date value MUST accept all three formats (for compatibility with HTTP/1.0), though they MUST only generate the RFC 1123 format for representing HTTP-date values in header fields.