Skip to content

Pace PageSpeed API requests across routes - #259

Merged
michaelbonner merged 1 commit into
masterfrom
fix/pagespeed-api-request-pacing
Nov 21, 2026
Merged

michaelbonner merged 1 commit into
masterfrom
fix/pagespeed-api-request-pacing

Conversation

@michaelbonner

Copy link
Copy Markdown
Collaborator

Summary

dashboard and preload requests
  -> getPageSpeedData
  -> shared two-second request reservation
  -> Google PageSpeed Insights API

Pace requests from both routes in one process. Remove the preload route's separate 500 ms delay.

Evidence

  • Before: Grafana recorded 32 PageSpeed API "Queries per minute" quota errors on November 19. The preload route could launch 20 requests 500 ms apart, while dashboard requests also ran concurrently.
  • After: TypeScript, ESLint, and the production build pass. The new reservation spaces calls to Google by two seconds per process. Live quota behavior needs verification after deployment.

Merge Danger

Door: Two-way

Blast Radius: PageSpeed requests

Cold batches wait longer: the twentieth request can start about 38 seconds after the first. The reservation is process-local, so multiple application processes would each have their own pace.

Reserve one request slot every two seconds across preload and dashboard requests to reduce the quota bursts seen in production logs.
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

🧹 Preview environment for this PR has been torn down.

@michaelbonner
michaelbonner merged commit ce9a829 into master Nov 21, 2026
2 checks passed
@michaelbonner
michaelbonner deleted the fix/pagespeed-api-request-pacing branch November 21, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant