4 ms·
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/dur
by solutionyogi 16y ago
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.
- cheald 16y agoCache-Control:max-age=221 That would do it.
- solutionyogi 16y agoI think you are over simplying. Look at http://www.mnot.net/cache_docs/ http://www.mnot.net/cache_docs/ for the nuances involved.
- cheald 16y agoI'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.
- sghael 16y agoBut 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).
- cheald 16y agoAssets, yes. Pages, no. Query strings for cachebusting CSS/images is pretty standard.
- deleted 16y ago[deleted]
- sghael 16y agoI 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.
- smackfu 16y agoI 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.