perf: don't download media files - #127
Conversation
|
Scope question before I finalise this: should we also drop URLs that are media files also should we mention this in readme? |
Headline
Breakdown
The Two adjacent buckets not in the 8,641, in case you want them counted:
TrendMedia share is growing: 0.14% in mid-May → 0.46–0.48% in late July (~3x), with absolute volume up from ~230 to ~1,450 per week. Small in share, but the direction is consistent.SummaryBefore I read the "Trend" part I was thinking to drop media requests. But then it got me thinking that maybe we shouldn't.At the same time, we can't really convert an image to markdown. So I would probably block media even if it's a URL (not docs though). If it's not a one-liner - let's skip it for now. If it is, let's drop media support for URLs too (images and videos only for now). |
|
Great, that's exactly what the PR does + skipping audio |
nicklamonov
left a comment
There was a problem hiding this comment.
I will test on some beta version, when it's released. So approving for now.
Closes #109.
This went bigger than I expected
createRequestmarks media-file URLs withskipNavigation; both request handlers return an empty result withSkipped media fileinstead of parsing a page.src/media.ts:isMediaUrl(extension of the last path segment) andblockMediaRequests, apage.routehandler abortingimage/media/font.enableBlockingInPage, because the Ghostery handler continues everything it doesn't block.checkValidResponseintopushSkippedResult, shared by both call sites. It now takes the status code from the caller — the oldresponse.status()doesn't exist on the raw-http response.isMediaUrl, three standby tests using a request counter on the test image.Applied to both url2m and rag