lighthouse
lighthouse copied to clipboard
PSI Lighthouse now returns cached versions when running subsequent requests.
FAQ
- [ ] Yes, my issue is not about variability or throttling.
- [X] Yes, my issue is not about a specific accessibility audit (file with axe-core instead).
URL
https://tekton.com
What happened?
Hello, I'm not sure where the best place is to report this issue, so please let me know!
I've noticed this past week, the PSI API (including pagespeed.web.dev) will now return cached results for subsequent requests for insights of the same URL.
This is a hindrance when running multiple PSI requests for the same URL in hopes of using the median score due to perf score variability as noted on Google's Lighthouse reports. Any help would be great.
Thank you.
What did you expect?
It would be great if subsequent requests did not return cached results for statistical reasons.
What have you tried?
I've tried waiting a few minutes before running the tests again and it seems to work. But this is not an ideal workaround.
How were you running Lighthouse?
CLI, PageSpeed Insights
Lighthouse Version
9.6.2
Chrome Version
No response
Node Version
16.15.1
OS
Mac
Relevant log output
No response
Would love to have a lighthouse flag, where it runs the page twice. Once with no cache, and second with cache. Would be nice to have lighthouse return two results (LHR), one without cache on and one without. To record both version of the page.
I've noticed this past week, the PSI API (including pagespeed.web.dev) will now return cached results for subsequent requests for insights of the same URL.
We moved our cacher to a 1 minute cache time, so subsequent requests within that window will be returned from our response cache. If you're trying to call the same URL multiple times to reduce variance, you should request them >1 minute apart, or add something like specific query params to cache bust.
Would love to have a lighthouse flag, where it runs the page twice. Once with no cache, and second with cache. Would be nice to have lighthouse return two results (LHR), one without cache on and one with. To record both version of the page.
This is not the correct understanding of this issue iiuc. The "cache" here is a server response cache, not anything to do with Lighthouse itself. If we see multiple requests for the same exact URL within the same minute we respond with a cached response to reduce duplicate work on the server. We don't control the browser cache or anything like that via this caching, this is entirely a server cache on our backends.