sitespeedio / sitespeedio/sitespeed.io

Cache not disabled on Chrome browser when passing disable arguments

Open
#4,580 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5k
Forks
624
Avg merge
4h 8m
Merged PRs (30d)
2

Description

Have you read the documentation?
URL

script with multiple urls

What are you trying to accomplish

We have a need to collect perf metrics on the page when cache is disabled or nothing is cached on the client Browser.
I tried to accomplish this with several sitespeed.io provided command line arguments but none appear to work:

  • --browsertime.chrome.args="--disable-cache,--disable-application-cache"
  • --browsertime.cacheClearRaw true --browsertime.cacheClear true
What browser did you use?

Chrome

How to reproduce
Execute the script on Windows Desktop as follows:
 
node bin/sitespeed.js -b chrome -n 1 --browsertime.chrome.args="--disable-cache,--disable-application-cache" --browsertime.chrome.args="--incognito" --firstParty .*domain.* --video --visualMetrics --multi search_notCached.mjs


Here is the script: 

/**
 *
 * @param {import('browsertime').BrowsertimeContext} context
 * @param {import('browsertime').BrowsertimeCommands} commands
 */
export default async function (context, commands) {
    const seleniumWebdriver = context.selenium.webdriver;
    const By = seleniumWebdriver.By;
    const seleniumDriver = context.selenium.driver;
    await seleniumDriver.manage().window().maximize();

    await commands.navigate(
        'https://domain/';

        await seleniumDriver.findElement(By.id('searchval')).sendKeys('green cup');
        const search = await seleniumDriver.findElement(By.xpath('//div[contains(@class,"lt:flex")]//button[@value="Search"]'));
        await commands.measure.start('Search');
        await search.click();
        await commands.wait.byPageToComplete();
        await commands.measure.stop();
};


Still shows memory and disk cache for JS: 

---See image showing cache happening in the previous section above---
Log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin/sitespeed.js and the supplied search_notCached.mjs reproduction, then trace how the --browsertime.chrome.args, --browsertime.cacheClearRaw, and --browsertime.cacheClear options reach Chrome. Reproduce the Windows Chrome run and verify whether the resulting metrics still show memory or disk cache usage when cache-disabling arguments are supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.