How accurate is YSlow at finding the components in the page? Why do YSlow and some packet sniffers differ?
There are two main approaches for finding components in a web page: sniffing packets and crawling the DOM. Firebug’s Net Panel, ethereal, and IBM Page Detailer are packet sniffers. YSlow, Instant Source, and the AIS Accessibility Toolbar crawl the DOM. The problem with sniffing packets is sometimes components are read from the browser’s disk cache. If the user forgets to clear their cache, the components shown by the packet sniffer don’t reflect all the components in the page. Packet sniffers tell the user only about the components that generated network traffic for the current web page request. DOM crawlers, on the other hand, report all the components found in the DOM of the current page, whether they were read from disk or downloaded over the Internet. The problem with DOM crawlers is not all HTTP requests show up in the DOM. Specifically, beacons, XHR, and JSON requests aren’t found in the DOM. YSlow is a combination of a DOM crawler and a packet sniffer.