

What’s in Your iOS Image Cache? - FSecurePal
http://blogs.sans.org/appsecstreetfighter/2011/01/14/whats-in-your-ios-image-cache-backgrounding-snapshot/?utm_source=rss&utm_medium=rss&utm_campaign=whats-in-your-ios-image-cache-backgrounding-snapshot

======
stcredzero
I should also post this to stackoverflow, but I'm wondering if anyone knows if
and how inline images are cached in web pages on iOS. I'm interested in
particular how a UIWebView would behave with code like:

    
    
        <img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLSyH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPjgAwXEQA7"
        alt="embedded image">
    

Is this known to be cached somewhere else on the device?

EDIT: I suppose I could use find on the simulator's directories and look for a
file with the right MD5 hash.

~~~
saurik
I am reasonably confident that such an image is "cached" by being part of an
HTML document that itself was cached. I mean, the URL for the thing is the
content: one would seriously hope that there isn't a URL->data cache somewhere
holding that image ;P.

~~~
Someone
1\. The decoded Base64 data is smaller (three quarters of the size?) than the
encoded data.

2\. Keeping only the encoded data would mean having to decode it every time
the image gets redisplayed.

Ideally, one would remove the Base64 coded data from the document, and cache
the binary data.

~~~
mike-cardwell
And when the page is loaded again, how would the browser know that the base64
encoded data in the page matches the binary data that has been cached?

~~~
Someone
Good question. I would guess that it would just decode it again when it
reloads the page. That shouldnt happen often, if people set the page's time-
to-live correctly. If they don't, you have to reparse the page anyways, as any
content could have changed.

When redisplaying a page without reloading, the browser should just use the
parsed page.

------
egb
Anybody know the Frank Kim who wrote the article? I tried to contact him to
say that his captcha always says "invalid" but he doesn't have any contact
info on there that I could find...

