News for hackers. Stuff that matters.
Re:IPad 2 Official Specs by solutionyogi on Wednesday March 02, 2011 @02:24PM (#2280812)
I completely agree. Their website roll out team kicks ass! They should publish how they manage the 'browser caching' issue, whenever I go to Apple.com after/during keynote, I get the latest page without doing hard refresh.
Re:IPad 2 Official Specs by sghael on Wednesday March 02, 2011 @02:53PM (#2280973)
I don't disagree they they must have their act together to support such big online launches. But for cache busting, isn't it just a simply matter of renaming resources and having your framework + deploy scripts manage the rest for you?

most sites use assets with additional query parameters added to keep them fresh (i.e. file?1234566778.js). Apple looks like they are adding some parameters into the filenames themselves.

It probably also involves cache-control settings as mentioned, but I think file renaming is the more reliable method of cache busting.

Re:IPad 2 Official Specs by cheald on Wednesday March 02, 2011 @02:27PM (#2280831)

    Cache-Control:max-age=221
That would do it.
Re:IPad 2 Official Specs by solutionyogi on Wednesday March 02, 2011 @02:49PM (#2280955)
I think you are over simplying. Look at http://www.mnot.net/cache_docs/ for the nuances involved.
Re:IPad 2 Official Specs by cheald on Wednesday March 02, 2011 @05:00PM (#2281550)
I'm really not. max-age and the Expires header, properly set, will control caching at just about every possible step. If you refresh apple.com several times, you'll notice the max-age cycles down with each refresh, and the Expires header stays the same. They're obviously set up to cause the page to have a short maximum lifetime in both public and private caches, and in the case of a launch, it's not that hard to make sure that the old copy of the page expires at 11 AM PST or whenever you want your announcement to go live.

Announce product, push deploy button on website, people hit website and browser requests a new copy of the page because its current copy expired at 10:59:59, and presto, it all magically works.

Re:IPad 2 Official Specs by sghael on Wednesday March 02, 2011 @06:52PM (#2282011)
But that only solves for the case of predictable events. If you want to remain agile, and do deployments on an as-needed basis, then you need to cache bust with file naming or query parameters as I mention in other msg. Again, I'm pretty sure this is the preferred method of most web teams, and also appears to be what Apple is doing (atleast with a subset of their assets).
Re:IPad 2 Official Specs by cheald on Wednesday March 02, 2011 @11:23PM (#2282810)
Assets, yes. Pages, no. Query strings for cachebusting CSS/images is pretty standard.
Re:IPad 2 Official Specs by smackfu on Wednesday March 02, 2011 @03:57PM (#2281269)
I seem to recall the last set of updates before this speech didn't work perfectly. People were seeing the results of mixed stylesheets and had to do forced refreshes to clear it.