sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.75k stars 603 forks source link

Extending FirstParty Configuration #3651

Open gregorywolf opened 2 years ago

gregorywolf commented 2 years ago

Feature/improvement

I am creating a new feature request as an extension of #3642. Currently the --firstParty directive can be used to include every possible first party call that may be encountered. This is not too difficult to do if a single TLD is tested. The best approach is to not use the --firstParty attribute initially and then add specific TLDs after reviewing the results.

However, a more difficult and error prone process is when multiple TLDs are tested for purposes of competitive analysis. The problem is that the --firstParty attribute must include EVERY possible variation of TLDs that could be encountered and accounted for during a test. This is not very practical.

A better approach would be to enter just the "additional" TLDs that account for first party calls. For example. If there is a an external URL file that contains various cellular companies, one of which is www.verizon.com, testing will show that *.vzw.com is also an associated first party call for Verizon. Currently it would be necessary to construct a large RegEx expression that includes all of the TLDs from the URL file PLUS and new first parties of interest. A better approach would be to have the ability to use an attribute that associates *.vzw.com with JUST www.versizon.com without having to explicitly enter all of the TLDs for the entire test.

soulgalore commented 2 years ago

Hi @gregorywolf , what I'm struggling with is to find a good pattern for the configuration?

gregorywolf commented 2 years ago

Hi @soulgalore, I don't follow. Please provide some more context for your question. Are we talking about RegEx specifically or just in general how something like this capability would come into play?

soulgalore commented 2 years ago

I'll try explain after the weekend!

soulgalore commented 2 years ago

Today we do not have a way of providing extra information per URL that you test that are specific to that URL. You can build that yourself in a script, but there's no way with command line parameters as I understands it. I think what could work would be to add that first party configuration with a new JSON configuration, something like:

1st parties:

{
"https://www.sitespeed.io" : ["*sitespeed.*"],
...
}