Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to specify a domain as third party so it is excluded? #525

Open
rmaclean-ee opened this issue Jan 7, 2021 · 1 comment
Open
Labels
enhancement New feature or request P2

Comments

@rmaclean-ee
Copy link

The scenario is webpage has content from multiple sources, including CDNs and other sites - when running LHCI against the webpage those external sources are included and it would be good to easily exclude them.

Example: Images come from a CDN and the cache TTL is not controllable, so uses-long-cache-ttl alerts for the images.

I have tried using assertMatrix but that doesn't seem to work for all content types. XHR seem to be ok with this but images, for example, are not possible with that.

@patrickhulce
Copy link
Collaborator

Thanks for filing @rmaclean-ee!

The short answer is no, but we're open to the feature request. You can achieve this by blocking the resources entirely though!

Our recommendation for using Lighthouse in CI is to limit the number of live third-party dependencies being used. It's likely the only path to asserting performance metrics reliably without unbearable variance as well. You can achieve this on a page that still references third-party code by using Lighthouse's --blocked-url-patterns (collect.settings.blockedUrlPatterns in your lighthouserc.js).

We'll leave this open to track the concept of a ignoreItemsByUrlRegex: /googleanalytics/ in Lighthouse CI 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2
Projects
None yet
Development

No branches or pull requests

2 participants