Ok web perf folks, I'm running an experiment on webpagetest.org
right now to look at a bunch of cache/user behaviors based on the resource timing interface and I could use some help in poking holes in the logic before I run the test for too long and have to throw out data :-).
WebPagetest has a shared site-wide js file (site.js) that is versioned. I am also using js to store a value in both a cookie and in local storage. I use the resource timing interface to walk the requests and look for "interesting" requests to see if they were made on the wire (site.js for example).
If site.js is loaded or if either the cookie or local storage value are not set then I am considering the page load to be a "new visitor" (I'm also disabling the code when a cache control header is present on the page request to avoid picking up browser reloads).
What I'm looking to see are how often the 3 different indicators of a new visitor don't match (i.e. how often do they already have site.js but not the cookie or how often is site.js loaded but local storage says they should already have it). I incremented the site.js version when the experiment started so all 3 should be in sync and the evaluation code is run right after site.js is loaded.
While I'm collecting the data I also want to see how often these "new visitors" already have some common third-party resources cached (jquery from Google's ajax libraries, Google Analytics, Adsense, The +1 js and the twitter js) so I see if they were requested in the resource timing. I'm also logging the browser version so we can see if IE 10 and Chrome behave differently (though I don't get many IE visitors so there may not be a lot of data there).
I'm gathering the data at onload just to make sure any async requests have had a chance to populate in resource timing. I'm also logging IP addresses to make sure a small number of usersdon't skew the results. Are there any other potential holes you can think of?
In just a few minutes of collecting data it's clear that the results are going to be interesting. I have seen pretty much every permutation of one of the persistent stores losing the stored state.