All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal Time). This is indicated in the first two formats by the inclusion of "GMT" as the three-letter abbreviation for time zone...
Tapalcatl is currently sending timestamps in RFC1123Z format, which does not exactly comply with the spec. Most servers and clients appear to be fine parsing it, but it causes a problem with Varnish, as the latter is very strict. This, in turn, causes Fastly to be unable to take advantage of "304 Not Modified" responses to If-Modified-Since conditional requests.
TimeFormat is the time format to use when generating times in HTTP headers. It is like time.RFC1123 but hard-codes GMT as the time zone. The time being formatted must be in UTC for Format to generate the correct format.
We should use the http.TimeFormat for generating times, and http.ParseTime for parsing them, to make sure we're standards-compliant and Varnish is happy.
The HTTP spec says:
Tapalcatl is currently sending timestamps in
RFC1123Z
format, which does not exactly comply with the spec. Most servers and clients appear to be fine parsing it, but it causes a problem with Varnish, as the latter is very strict. This, in turn, causes Fastly to be unable to take advantage of "304 Not Modified" responses toIf-Modified-Since
conditional requests.The Go
http
package provides aTimeFormat
constant and says:We should use the
http.TimeFormat
for generating times, andhttp.ParseTime
for parsing them, to make sure we're standards-compliant and Varnish is happy.