Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions internal/client/browser_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,22 @@ func (p *BrowserPool) RenderPage(ctx context.Context, targetURL string) (string,
}
defer page.Close()

// Apply minimal performance optimizations
// Block only the most resource-intensive content types
if !testing.Testing() {
page.Route("**/*", func(route playwright.Route) {
resourceType := route.Request().ResourceType()
switch resourceType {
case "image", "media", "font":
// Block only heavy resources
route.Abort()
return
default:
route.Continue()
}
})
}

// Setup debug handlers if running in test mode
var consoleLogs, networkLogs []string
if testing.Testing() {
Expand Down