Skip to content

Lighthouse doesn't clear browser cache before running #2064

Description

@trueadm

I'm building a benchmark runner tool that runs various different benchmark implementations through Lighthouse and compares the performance statistics.

The issue I'm having is that it appears that Lighthouse has an aggressive cache, and returns the first benchmark each time – even though the backend is serving different content on the same URL (http://localhost:8080 in this case).

If I tell Lighthouse to look at a different URL, this is no longer an issue (for example http://localhost:8080/benchmark2). The thing is, I don't want Lighthouse to cache anything when loading http://localhost:8080. If I load Chrome Canary locally and refresh the same URLs manually, I don't have this issue.

You can see how I'm setting up Lighthouse and using it on this fork:

https://github.com/trueadm/react/blob/add_benchmarking_infra/scripts/bench/benchmark.js#L98

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions