It was the 01 Jan 1970 00:00:01 GMT
Actually, it was already January 1, 1970. For many it is just another date, for others it is the origin of time, also known as UNIX Time, the number of seconds elapsed since midnight on Jan 1 1970.
But I don't want to talk about UNIX Time this time, but about a small detail that found me while I was writing some flowtests for one of Cloudflare's services. The service in question is irrelevant, unlike the HTTP header I received in one of the requests. It contained a date that disturbed my state of mental peace and concentration to the point of forcing me to write this article:
expires: Thu, 01 Jan 1970 00:00:01 GMT
The strange thing here is not the expiration header, although it may not be the most current method, it is understood that it is not to invalidate the cache, but to prevent the resource from being cached in the first place. To achieve this they set an expiration date in the past and what better date than that when practically no electronic computer existed in the world, Thu, 01 Jan 1970 00:00:00 GMT.
In any other service, that extra second would not have caught my attention but we are talking about Cloudflare, Cloudflare! Those who protect the Internet with a wall of lava lamps, those who have mitigated some of the largest DDoS attacks in history, those who built 1.1.1.1, those who use HTTP/3 in massive production, the very same ones who have dared to protect even the rights of users to an open internet against the very abuse of some.
That extra second was put there for a reason, and surely the answer has to do with the way data is encoded in the software that still runs and sustains our civilization.
That date format is just an interface, an agreement by which two or more parties exchange information while hiding the internal details of the implementation. That format could well represent dates before 1970, even before the year 0.
Surely there is still a lot of software, more or less old, that internally represents UNIX time as an integer, but also gives a special meaning to 0. This practice is very common and not only for dates, but for any type of data.
The people at Cloudflare, in their infinite wisdom, have wanted to lend a hand to all that software that sustains the heartbeat of our digital world, not only by maintaining a header that old systems still understand, but also by preventing their internal implementation from failing miserably because of a special zero.
Note: The recommended way to avoid caching is via Cache-Control: no-store
Comentarios