Skip to content

Skip prefetching anchors with the download attribute#490

Open
sankalpsthakur wants to merge 1 commit into
GoogleChromeLabs:mainfrom
sankalpsthakur:skip-download-attr-prefetch
Open

Skip prefetching anchors with the download attribute#490
sankalpsthakur wants to merge 1 commit into
GoogleChromeLabs:mainfrom
sankalpsthakur:skip-download-attr-prefetch

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Do not observe / prefetch <a download> links by default (boolean or named download attribute)
  • Applies in both listen (src/index.mjs) and the chunks path (src/chunks.mjs)
  • Adds a fixture + puppeteer test and a short README note under Custom Ignore Patterns

Fixes #181

Why this matters

Download links often target large binaries (PDFs, archives, exports). Prefetching them wastes bandwidth and cache space on paths the user may never follow — especially on metered or Save-Data connections where quicklink already throttles prefetch. Treating download like other built-in ignore patterns (external origins, rel=nofollow, etc.) keeps prefetch focused on navigational routes.

Test plan

  • npm test (19/19 passing)
  • npm run size (within limits)
  • npm run lint
  • Confirm CLA check passes for @sankalpsthakur

@google-cla

google-cla Bot commented Jul 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sankalpsthakur

sankalpsthakur commented Jul 22, 2026

Copy link
Copy Markdown
Author

CLA signed for @sankalpsthakur / sankalphimself@gmail.com. cla/google is green.

Links marked for download often point at large binary payloads; excluding
them by default avoids wasted bandwidth while keeping ignores for custom cases.
@sankalpsthakur
sankalpsthakur force-pushed the skip-download-attr-prefetch branch 2 times, most recently from ad00787 to 6553f38 Compare July 22, 2026 09:03
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.

Do not prefetch links with download attribute

1 participant