PageSpeed monitoring, Polar billing, sidebar polish, frontend consistency audit #68

Merged
uz1mani merged 45 commits from staging into main 2026-03-23 19:07:54 +00:00
5 changed files with 684 additions and 0 deletions
Showing only changes of commit d1af25266b - Show all commits

View File

@@ -76,8 +76,16 @@ export async function getPageSpeedCheck(siteId: string, checkId: string): Promis
}
export async function triggerPageSpeedCheck(siteId: string): Promise<PageSpeedCheck[]> {
const res = await apiRequest<{ checks: PageSpeedCheck[] }>(`/sites/${siteId}/pagespeed/check`, {
method: 'POST',
})
return res?.checks ?? []
// * PSI checks take 10-30s per strategy (mobile + desktop sequential = up to 60s)
const controller = new AbortController()
const timeoutId = setTimeout(() => controller.abort(), 120_000)
try {
const res = await apiRequest<{ checks: PageSpeedCheck[] }>(`/sites/${siteId}/pagespeed/check`, {
method: 'POST',
signal: controller.signal,
})
return res?.checks ?? []
} finally {
clearTimeout(timeoutId)
}
}