0

requestStart time

Hi,
I am a newbie in javascript and web world. I just saw your JS code for PLT measurement. its a fantastic job.
My question.
How do I know if the page is fetched from cache or not?
according to your js code you sait, requestStart will be 0 if it is fetched from cache(browser cache?).
I checked Chrome demo page http://webtimingdemo.appspot.com/ that implemented web timing API. when analysed the value of requestStart time was never 0 even if I clean up the browser cache. (may be i am wrong).

wht is your opinion abt that?

thanks in advanced.

by
3 Replies
  • My guess is that the spec changed after I wrote that. The new spec states that it will be the timestamp when the request started either from the server or from local cache or local disk. Given that, requestStart will never be 0.
    0
  • thanks for the reply. Another question related to page load time. Why didn't you use loadEndTime to get the end time.
    Getting inspiration from your code I was trying simple code for one of my site to measure page load time, here is my java script:

    var delta;
    var minutes;
    var browserCompatible = new Boolean();
    var countPlt = new Boolean();
    var performance = window.performance || window.mozPerformance ||
    window.msPerformance || window.webkitPerformance || {};
    var timing = performance.timing || {};
    var navigation = performance.navigation || {};

    var performance = window.performance || window.mozPerformance ||
    window.msPerformance || window.webkitPerformance || {};
    var timing = performance.timing || {};
    var navigation = performance.navigation || {};

    function load_time() {
    var start, end;
    //We want to track the requests every 6th minute after on in a hour.
    if (((new Date().getMinutes() % 6) == 0) || new Date().getMinutes() == 0) {
    countPlt = true;
    }
    else { countPlt = false; }

    //Check if browser support this API
    if (performance && timing) {
    browserCompatible = true;
    }
    else { browserCompatible = false; } //end

    //if (browserCompatible && countPlt) { //1 start
    start = timing.navigationStart;
    end = timing.loadEventEnd;

    //if (end > 0) {
    delta = end - start;
    //}
    return delta;
    }

    I am getting 0 for loadEndTime. I dont know why. do you have any insight as you didnt use loadEndTime in your script.
    Thanks again.
    0
  • loadEventEnd is 0 if the onload event hasn't fired yet. You can only call it after the onload event fires.

    We don't use it in boomerang, because it isn't supported across browsers, and also there may be several cases where the developer does not want to measure when onload fires, but wants to measure some other time. Example applications are Google Maps and Yahoo! Mail which load most of their content after the onload event fires.
    0
This forum is locked.

Recent Posts

in Boomerang