[X-Apps] How does the safari cache work?

db lists at drunkenbatman.com
Sun Sep 7 20:58:53 PDT 2003


On Fri, 5 Sep 2003 16:42:37 +0700, Robert Nicholson wrote:
> Why does safari need to contact the web site if it's contents are 
> already in the cache?

Because it wants to see if what it has stored has changed before it 
displays the view. Safari's caching mechanism is a little different and 
not suited for "offline" viewing as such, but rather a 
forwards/backwards cache. It does have large advantages, tho.

IE, turn on the debugging menu and you'll be able to view the DOM tree 
of the page you're looking at, as well as the render tree, view tree, 
etc. Once the HTML & such as been downloaded it has to be "rendered". 
IE, table cells have to be positioned, etc. This is a hierarchal format 
(head, body, etc). If you're using something based on the gecko engine, 
once all that stuff is rendered (the longest part of the process 
usually if you're on broadband) it is held in memory until the view 
changes, such as clicking a link or closing a window, at which point 
it's flushed and has to be re-rendered if you go back to it.

Which is why hitting backwards & forwards is so much faster using 
Safari versus some of the others... when you click back, it checks to 
see if the page has changed... hasn't? Good, just use the old DOM tree. 
Check to see if the images requested are in cache, etc, etc.

> I should be able to visit sites from my "history" and I should not be 
> online to see their contents.

Well, yeah in a perfect world. And really, it wouldn't be that hard (in 
the grand scheme of things) to add that capability... but I wouldn't 
hold my breath on it getting in. Sorta like mail- there are lots of 
things you _should_ be able to do, but for one reason or another it 
isn't going to happen. I'd file a feature request with Apple.



More information about the X-Apps mailing list