Skip to content

optimization: normalize dedup status: treat 0 (response code not yet known) or 206 as 200… #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

ikreymer
Copy link
Member

Avoids fetching duplicate content when fetched through different code path (eg. autoplay behavior calling fetch, vs video playing automatically)

… to avoid fetching duplicate content when fetched through different code path
@ikreymer ikreymer requested a review from tw4l May 11, 2025 02:33
@ikreymer ikreymer changed the title optimization: normalize dedup status: treat 0 (unknown response code) or 206 as 200… optimization: normalize dedup status: treat 0 (response code not yet known) or 206 as 200… May 11, 2025
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a risk in treating 0 as 200 for purposes of dedupe, that content may actually not have been captured?

@ikreymer
Copy link
Member Author

Is there a risk in treating 0 as 200 for purposes of dedupe, that content may actually not have been captured?

The check happens before the fetch starts, to see if it should be skipped. Sometimes the status code is already known (if coming from browser) while other times it is not yet (when doing a full fetch call in node). I guess technically it could still fetch headers to know what status is in the latter case, but that requires more refactoring (can be done as a follow-up)

@ikreymer ikreymer merged commit 7bf10f7 into main May 28, 2025
4 checks passed
@ikreymer ikreymer deleted the normalize-dedup-status branch May 28, 2025 22:46
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.

2 participants