Archive

Posts Tagged ‘swf’

Nasty Bug: Safari doesn't cache stuff.

April 4, 2008 30 comments
Strolling - Nairobi State Park by Simon Barnes

photo by: Simon Barnes

I swear I’m not making this up.

I couldn’t believe my eyes when I found it. Safari is one of our favorite browsers, and we love their work on standards compliance and speed, particularly JavaScript, but this particular bug is really driving us crazy. I’ve logged it with Apple (#5786274), and a fix is promised, but in case you’re getting hit with this and are as baffled as I was, here are the details:

  • If your computer has less than 1GB of RAM, Safari fails to cache items larger than 104,857 bytes.
  • If your computer has more than 1GB of RAM, Safari failes to cache items larger than 209,715 bytes.
  • JPEGs, at least, are temporarily cached in RAM. Whew. But upon browser restart, you’ll see they didn’t make it to the disk cache, so you have to get them again.
  • Other objects, like SWFs or videos, though, don’t even make it to the RAM cache, let alone disk. Load the same SWF back-to-back, and you’ve just transfered the bytes twice. Ugh.

Very easy to reproduce yourself from the comfort of your own home, so go for it. Just fire up HTTP Scoop or Wireshark or tail your server’s HTTP logs and start hitting stuff. Marvel at the # of excess bytes transferred across the wire that you didn’t need. 😦

Here are a couple of test URLs so you can see for yourself:

As a self-professed Apple fanboy, I can’t wait for a fix. In the meantime, we’ve had to jump through all sorts of hoops to ‘dumb down’ some of our most exciting new features. 😦

UPDATE: Yes, I’ve tried with every Cache-Control and Expires header known to man. No, it doesn’t make a difference. Try it yourself.

%d bloggers like this: