<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">

    <title>LightPress</title>
    <subtitle>A fast, template-based frontend for WordPress</subtitle>
    <updated>2005-10-05T14:53:16+00:00</updated>
    <id>http://lightpress.org/</id>
    <link rel="alternate" type="text/html" hreflang="en-US" href="http://lightpress.org" />
    <link rel="self" type="application/atom+xml" href="http://lightpress.org/atom.xml" />
    <rights type="html"><![CDATA[&lt;br /&gt;&amp;copy;2004-2006 L. Magnocavallo, J. Lavigne. Header image &amp;copy; &lt;a href=\&quot;http://flickr.com/photos/vanhap/\&quot;&gt;vanhap&lt;/a&gt;.]]></rights>
    <generator uri="http://lightpress.org" version="2.0.0">LightPress 2.0.0</generator>

    
    <entry>
        <title type="html">PHP, HTTP/1.1 dates and Conditional Get</title>
        <link rel="alternate" type="text/html" href="http://lightpress.org/post/php-http11-dates-and-conditional-get" />
        <id>http://lightpress.org/post/php-http11-dates-and-conditional-get</id>
        <author>
            <name>ludo</name>
        </author>
        <published>2005-06-08T15:03:47+00:00</published>
        <updated>2005-06-08T15:03:47+00:00</updated>
        <content type="html" xml:lang="en-US" xml:base="http://lightpress.org/post/php-http11-dates-and-conditional-get"><![CDATA[<p>One of the benefits we might get from the <a href="http://lightpress.org/post/is-frontend-too-big#249">new architecture I'm testing</a> 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 <a href="http://fishbowl.pastiche.org/archives/001132.html">Conditional Get</a>.</p>
<p>I had already adapted <a href="http://simon.incutio.com/archive/2003/04/23/conditionalGet">Simon Willison's code</a> to work around a <a href="http://bugs.php.net/bug.php?id=31842">bug in PHP's</p>
<code>
date</code>
<p>formats</a> (fixed in 4.3.11), but the code was a bit too complex for my tastes, and re-reading the relevant parts of the <a href="http://www.faqs.org/rfcs/rfc2616.html" title="RFC2616#3.3.1">HTTP/1.1 specification</a>, I noticed that full compliance requires supporting three different date formats, all in GMT:</p>
<blockquote>
<p>Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123<br />
<br /><br />
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036<br />
<br /><br />
Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format</p>
<p>All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception.</p>
<p>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.</p>
</blockquote>
<p> <a href="http://lightpress.org/post/php-http11-dates-and-conditional-get">continued</a>]]></content>
    </entry>
    
</feed>

