How does YSlow calculate grade for each of the performance rules?
YSlow uses the components’ HTTP response headers to compute a score for each of the 34 performance rules or best practices for speeding up a website. For example, YSlow uses the Expires header to evaluate Rule 3, and the ETag header for Rule 13. If necessary, YSlow gets this header information by re-requesting the components using XMLHttpRequest, but this takes time and CPU.