8

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 ;)

14
  • 4
    The only way you're going to get an answer that doesn't start with "Probably because" is if you ask Google. Everything else will just be speculation.
    – Walter
    Commented Nov 26, 2012 at 13:16
  • 5
    Your edit doesn't change the fact that only Google can give you an accurate answer.
    – Walter
    Commented Nov 26, 2012 at 13:42
  • 3
    I agree, there may be valid technical reasons to do this and Googles 8 day limit makes a good example. (though I'm not 100% sure if question belongs here or on StackOverflow) Commented Nov 26, 2012 at 14:09
  • 3
    @Walter: I disagree. "Can anyone think of a reason why they would want to reduce its cache lifetime to just 8 days?" – I am asking for any reasonable reason why a web-savvy company might want to do this. (Of course, I wouldn't be asking the question if it was just any website, but Google are doing it, which makes me wonder if there might an important gap in my knowledge.)
    – callum
    Commented Nov 26, 2012 at 14:12
  • 4
    I think ths question has drifted into the not constructive zone.
    – Ryathal
    Commented Nov 26, 2012 at 22:02

3 Answers 3

5

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.

1

Probably because they change the logo often, when they celebrate a personality or an event.

2
  • 8
    That can't be the reason as each of the logos they use has a distinct URL so reducing the caching duration wouldn't give any benefit.
    – Dan D.
    Commented Nov 26, 2012 at 12:09
  • 3
    Thanks, but please see my edit for why this answer is incorrect.
    – callum
    Commented Nov 26, 2012 at 13:05
-4

Probably because they change their logo often: caching servers would be full with Google logos that aren't used. This setting make caches remove the logo from their storage sooner.

3
  • 2
    Thanks, but this is wrong; see the second bullet point in my edit.
    – callum
    Commented Nov 26, 2012 at 12:59
  • 1
    I don't see why this cannot be seen as a piece of courtesy information. Your bullet point seems to be overly generalizing and ruling out this possibility. Commented Nov 26, 2012 at 13:14
  • 1
    Because it's misleading. Active web caches are always full to capacity, and constantly churning, so the idea that a web developer might need to worry about "filling up" clients' caches is simply wrong.
    – callum
    Commented Nov 26, 2012 at 13:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.