-
fix(nx-dev): fix double-counting and exclude assets from page tracking (#34286)
发布于
2026-02-02 17:17:32 +00:00 Current Behavior
- track-asset-requests runs twice per request due to redundant path
patterns:path: ["/*.txt", "/**/*.txt", "/*.md", "/**/*.md"]
The
/**/*pattern already matches root level files, so/*is
redundant.- track-page-requests runs on many asset requests even though it
only tracks HTML page views:- Font files:
/docs/fonts/*.woff2,/docs/*.woff - Images:
/docs/*.svg,/docs/*.png,/docs/og/* - Pagefind search index:
/docs/pagefind/*
- Font files:
Expected Behavior
- Asset tracking should fire only once per request
- Page tracking should exclude all non-HTML assets at Netlify level
(zero compute)
Changes
track-asset-requests.ts
Simplified path patterns:
path: ["/**/*.txt", "/**/*.md"]track-page-requests.ts
Added comprehensive exclusions:
Category Exclusions Images .svg,.png,.jpg,.jpeg,.gif,.webp,.ico,/images/*,/og/*Fonts /fonts/*,.woff,.woff2Search /pagefind/*Related Issue(s)
Fixes DOC-395
下载附件
- track-asset-requests runs twice per request due to redundant path