What reasons are there to reduce the max-age of a logo to just 8 days

cachingfront-endhttp

Most websites set max-age=31536000 (1 year) on the Cache-control headers of static assets such as logo images. Examples:

But there is a notable exception: Google's logo has max-age=691200 (8 days).

I've checked the headers on the Google logo in the past, and it definitely used to be 1 year. (Also, it used to be part of a sprite, and now it is a standalone logo image, but that's probably another question…)

What could be valid technical reasons why they would want to reduce its cache lifetime to just 8 days? Google's homepage is one of the most carefully optimised pages in the world, so I imagine there's a good reason.


Edit:

Please make sure you understand these points before answering:

  • Nobody uses short max-age lifetimes to allow modifying a static asset in future. When you modify it, you just serve it at a different URL. So no, it's nothing to do with Google doodles. Think about it: even if Google didn't understand this basic trick of HTTP, 8 days still wouldn't be appropriate, as only those users who don't have the original logo cached would see the doodle on doodle-day – and then that group of users would go on seeing the doodle for the following 8 days after Google changed it back 🙂

  • Web servers do not worry about "'filling up' the caches of clients (or proxies). The client manages this by itself – when it hits its own storage limit, it just starts dropping the lowest priority items to make space for new items. The priority score is based on the question "How likely am I to benefit from having cached this URL?", which is nothing to do with what max-age value the server sent when the URL was originally requested; it's a heuristic based on the 'frecency' of requests for that URL. The max-age simply lets the server set a cut-off point – the time at which the client is supposed to discard the item regardless of how often it's being re-used. It would be very nice and trusting of a downstream client/proxy to rely on origin servers 'holding back' from filling up their caches, but I don't think we live in that world 😉

Best Answer

Setting the max-age to 8 days instead of 1 year gives Google better control over the way it presents itself to the world. You're right that they can simply use a different URL for temporary changes like the Google doodle, but if they think they might want to change the way their real corporate logo appears, it makes sense to use a shorter expiration time for two reasons:

  1. Any references to their logo on any of their existing pages will change automatically -- no need to modify them to use a different URL.

  2. The countless third party web pages that load Google's logo will display the new version automatically after 8 days or less.

Furthermore, longer expiration times provide diminishing returns. With no caching, a typical user might load Google's logo a thousand or more times each year. An 8 day expiration cuts that down to 46 times a year. A 1 year expiration further reduces that to potentially as little as 1 time each year. It seems like the largest benefit, by far, is due to the fact that the image is cached at all -- caching for just 1 day provides a huge benefit, and caching for 8 days extends that somewhat.

Google logo

The image above is only 7007 bytes in size. Loading that every 8 days means that you're loading 312 kilobytes of their logo over the course of a year. That's really not a lot as a percentage of all the data you load from Google, and the good folks at Google have apparently made a decision that the flexibility they gain from the 8 day expiration is more important than reducing that number further. If they thought otherwise, you can bet they'd use a longer expiration time.

I don't work at Google, and even if I did I probably wouldn't be in a position to know their reasoning for certain, so the above is somewhat speculative. The real answer could be something as simple as: it seemed like a good idea at the time. Nevertheless, there's obviously a tradeoff between minimizing traffic and creative control, and I think we can tell from the expiration time that Google uses where they wanted to draw that line.

Also, I think it's worth noting that Google's isn't just any logo: it's the main feature on their most important web page, and it's presentation is something that they're known to be very careful about. The other sites that you mention (BBC, YouTube, Twitter, and Yahoo) all include their logo on their main page, but in each case the logo is smaller and a much less important element of the page than Google's is. Google has also made a number of changes to its logo over the years (no, I'm not talking about doodles), and there's no reason to think that they won't do it again.