A. How are D, B etc calculated?
Regarding the first parameter (First Byte Time), i have found one of your responses that goes like
<250ms => A
250-350 => B
350-450 => C
…
Can you provide info about the other ones as well e.g for caching:
<100KB then A, 100-200 KB then B etc or 1-3 non-cached date then A, if 4-6 then B etc
B. What effect will any recommendation that i apply have?
E.g if i have D for caching, if i cache 1 more file will it become C or it depends on the size of the file or other parameters? This is quite likely related to previous question.
The grades are a straight conversion from percentages (90+ = A, 80-89 = B, etc).
For the optimizations that have to do with size (gzip, image compression, minify) the score is calculated by the number of bytes that can be saved relative to the total number of bytes checked (so if the images can all be reduced 50% the score would be 50).
For most of the rest, it is a percentage of the checked objects that passed the check (pass = 100% for an item, warning = 50%). Any improvement will depend on the total number of objects.
Grades are only available if they are already calculated before import. They require the response bodies and can’t be calculated from the timeline data. For processing you need to have a Chrome trace with the appropriate devtools timeline event categories enabled. Even then, on the public WebPageTest instance the server is configured to not calculate trace data server-side (uses too much CPU and server time to make available). On a private instance it should work though.