Skip to content
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

Drop cache info when a redirection took place #1777

Merged
merged 1 commit into from
Mar 5, 2025
Merged

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Feb 17, 2025

When a redirection takes place, Reffy follows the redirection logic (typically done through scripting) but the cache info it gets from Puppeteer remains for the initial URL. Reffy incorrectly assumed that info also applied to the final page.

There's no easy way to retrieve the cache info of the final URL. Since that should only affect a spec that moves, and only until we detect and update the URL of the spec in browser-specs, this update simply drops the cache info to force Reffy to crawl the spec.

Fix #1774.

When a redirection takes place, Reffy follows the redirection logic (typically
done through scripting) but the cache info it gets from Puppeteer remains for
the initial URL. Reffy incorrectly assumed that info also applied to the final
page.

There's no easy way to retrieve the cache info of the final URL. Since that
should only affect a spec that moves, and only until we detect and update the
URL of the spec in browser-specs, this update simply drops the cache info to
force Reffy to crawl the spec.

Fix #1774.
mockAgent
.get("https://drafts.csswg.org")
.intercept({ method: "GET", path: "/server-hiccup/" })
.reply(200,
`<html><title>Server hiccup</title>
<h1> Index of Server Hiccup Module Level 42 </h1>`,
{ header: { "Content-Type": "text/html" } })
{ headers: { "Content-Type": "text/html" } })
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated fix. I don't think this had any practical implication in practice, but that was still wrong...

@tidoust tidoust requested a review from dontcallmedom March 5, 2025 07:22
@tidoust tidoust merged commit d1de0b6 into main Mar 5, 2025
1 check passed
@tidoust tidoust deleted the fix-cache-redirect branch March 5, 2025 08:00
tidoust added a commit that referenced this pull request Mar 5, 2025
Bug fixed:
- Drop cache info when a redirection took place (#1777)

Dependencies bumped:
- Bump web-specs from 3.41.0 to 3.42.0 (#1786)
- Bump puppeteer from 24.2.1 to 24.3.1 (#1785)
- Bump rollup from 4.34.8 to 4.34.9 (#1784)
- Bump undici from 7.3.0 to 7.4.0 (#1783)
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.

Crawl results stall when there's a redirect
2 participants