Closed abhinavn closed 6 years ago
Hi @abhinavn let me update the documentation so this is easier to understand. It work like this: When you run as default the cache is cleared between runs. If you test https://www.sitespeed.io 5 runs, the browser cache is cleared between each run, so the browser has no cached assets between the runs.
When you run --preURL
the browser starts, then access the preURL and then the URL you want to test within the same session and not clearing the cache. Use this if you want to measure more realistic metrics if your user first hit your start page and then another page (with responses in the cache).
preScript is the same behavior, we don't clear the cache between preScript and the URL you want to test.
If I use preScript is the cache already loaded? The subsequent URL launched is measured with cache?
Yes.
Why is there difference in fisrtVisualChange with and without --preURL?
Assets are cached and you can have HTTP connections already open depending how long time you wait between the first URL and the next.
Why is compress assets advice so different?
If the assets is on disk (in the cache) it doesn't matter if it was sent compressed over the wire the first time or not.
Hope that makes thing clearer.
Best Peter
@soulgalore - You rock! Thanks for detailed explanation. It helps.
I am testing URLs which are behind login authentication, i use --prescript.
docker run --shm-size=2g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.5.4 --preScript login.js tools/home.txt --preURL https://dc.stage.acrobat.com/ --browsertime.pageCompleteCheck 'return (function() {try { return (Date.now() - window.performance.timing.loadEventEnd) > 5000;} catch(e) {} return true;})()' --browsertime.viewPort 1920x1080 --browsertime.cacheClearRaw --browsertime.chrome.collectTracingEvents --speedIndex --video
docker run --shm-size=2g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.5.4 --preScript login.js tools/home.txt --browsertime.pageCompleteCheck 'return (function() {try { return (Date.now() - window.performance.timing.loadEventEnd) > 5000;} catch(e) {} return true;})()' --browsertime.viewPort 1920x1080 --browsertime.cacheClearRaw --browsertime.chrome.collectTracingEvents --speedIndex --video
If you notice above, there is difference when I use preURL in first screenshot and second screenshot without preURL, but the firstVisual Change metrics are different too
Questions
My goal is to measure page load times with primed cached, what is the suggested approach?