Repository navigation
fix(seo,perf): make programmatic pages cacheable and indexable, fix analytics / 让程序化页面可缓存、可索引并修复统计问题 - #1530
fix(seo,perf): make programmatic pages cacheable and indexable, fix analytics / 让程序化页面可缓存、可索引并修复统计问题#1530adibarra wants to merge 9 commits into
Conversation
…ayloads, fix analytics SEO - Every indexable EN/ZH page emits og:image and a summary_large_image card via a shared socialMetadata helper; /inference is self-canonical and in the sitemap; root canonical removed. - Titles <= 47 chars before the suffix, descriptions <= 155 (EN) / 120 (ZH); chips and glossary descriptions lead with what people search for. - Server-rendered h1 + intro on EN dashboard tabs (TabIntro), Dataset JSON-LD gains description/license/creator, sitemap adds explorer sections and real lastmod, /agentx/<unknown> 404s, dead URLs 308. - Content-Language header for /zh, compare hubs link canonical URLs. Performance - Compare, run, rankings, overview and blog index render with ISR (revalidate 3600) instead of force-dynamic; compare HTML embeds only the default sequence's rows. - API responses negotiate br/gzip/identity with Vary, strong ETag/304 and a 60 s browser max-age; ingest purges are stale-while-revalidate for CDN and ISR pages, with an immediate mode for corrections. - Dashboard benchmarks load in parallel with availability; bulk id lookups chunk to route limits (fixes log-availability 400). - Blog posts no longer ship dashboard JS; MDX figures use next/image with recorded dimensions; nav links prefetch on intent; root layout no longer fetches; proxy has a matcher; static asset cache headers; dead cron removed. - Layout-shift fixes on collectivex, agentic detail, calculator, operatorx, profit estimator and evaluation; collectivex null toFixed crash fixed. Analytics - Model switches record a virtual pageview; overview and profit filter changes no longer do; queued events keep original time/URL; PostHog via /ingest proxy; dead clicks off; no raw search text; outbound link, 404 and chart-render timing events; route_template/locale on pageviews. 中文: fix(seo,perf):让程序化页面可缓存、可索引,缩减数据体积,修复统计问题 SEO:所有可索引的中英文页面通过共享的 socialMetadata 输出 og:image 与 summary_large_image 卡片;/inference 改为自引用 canonical 并加入 sitemap, 移除根布局 canonical。标题(后缀前)不超过 47 字符,描述英文不超过 155、 中文不超过 120 字符;芯片与术语页描述优先给出用户搜索的信息。英文 dashboard 标签页加入服务端渲染的 h1 与简介;Dataset JSON-LD 补齐 description、license、 creator;sitemap 加入 explorer 分区并使用真实 lastmod;/agentx 未知 slug 返回 404;失效 URL 改为 308 跳转;/zh 返回 Content-Language;对比页入口链接指向 canonical URL。 性能:compare、run、rankings、overview 与博客索引改用 ISR(revalidate 3600), 不再 force-dynamic;对比页 HTML 只内嵌默认序列的数据行。API 按 Accept-Encoding 协商 br/gzip/identity,带 Vary、强 ETag/304 与 60 秒浏览器缓存;数据导入后 CDN 与 ISR 页面按 stale-while-revalidate 失效,数据更正可立即清除。Dashboard 的 benchmarks 请求与 availability 并行;批量 id 查询按接口上限分片(修复 log-availability 400)。博客不再加载 dashboard JS;MDX 图片改用带尺寸的 next/image;导航链接改为按意图预取;根布局不再请求数据;proxy 增加 matcher; 静态资源缓存头;移除失效的 cron。修复 collectivex、agentic 详情、calculator、 operatorx、profit estimator 与 evaluation 的布局偏移,以及 collectivex 的 toFixed 空值崩溃。 统计:切换模型记录虚拟 pageview,overview 与 profit 筛选变化不再记录;排队事件 保留原始时间与 URL;PostHog 经 /ingest 代理;关闭 dead click;不再发送原始搜索 文本;新增外链点击、404 与图表渲染耗时事件;pageview 带 route_template 与 locale。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
Vercel compiles an empty `:rest*` in a redirect destination to a trailing slash, so `/about/` redirected to itself. Split the rule into single-segment and multi-segment forms and test the redirects as compiled by @vercel/routing-utils. 中文: fix(config):修复 Vercel 上尾部斜杠跳转死循环 Vercel 会把跳转目标中为空的 `:rest*` 编译为带尾部斜杠的路径,导致 `/about/` 跳转到自身。将规则拆分为单段与多段两种形式,并用 @vercel/routing-utils 编译后的跳转规则进行测试。
…state Fixture builds send `Cache-Control: no-store` so Cypress intercepts see every API request (production keeps the 60 s browser reuse). InferenceContext no longer drops `i_label`/`i_advlabel` from the URL before the sequence resolves. Specs updated for intended changes: landing hero h1, next/image figure sources, ubenchX nav href, legend blocked state on the checkbox, zh run/rankings descriptions without the supporters line, overview URL state loading after hydration; two timing races in specs fixed. 中文: fix(e2e):fixture 模式下 API 响应不缓存,并保留 URL 中的标签设置 fixture 构建返回 `Cache-Control: no-store`,使 Cypress 能拦截每个 API 请求 (生产环境仍保留 60 秒浏览器缓存)。InferenceContext 在序列确定前不再从 URL 中删除 `i_label`/`i_advlabel`。按预期改动更新测试:首页主视觉改为 h1、图片 经 next/image 输出、ubenchX 导航链接、图例禁用状态位于 checkbox、中文 run/rankings 描述不再包含支持者说明、overview 在水合后加载 URL 状态;并修复 两处测试时序竞争。
The dynamic wrapper made ubenchx.cy.ts flaky (duplicate select triggers and late pins while the chunk loaded) and no longer saved anything: nav links prefetch on intent and the ubenchX nav link targets /ubenchx/mem-bw. 中文: fix(ubenchx):恢复直接渲染核心内存剖析页面 动态加载包装导致 ubenchx.cy.ts 不稳定(加载期间出现重复的选择触发器与延迟的 固定状态),且已无收益:导航链接改为按意图预取,ubenchX 导航入口指向 /ubenchx/mem-bw。
`/api/v1/invalidate?scope=operatorx&immediate=true` now expires the OperatorX CDN tag outright instead of marking it stale. 中文: fix(cache):OperatorX 范围清除支持 immediate `/api/v1/invalidate?scope=operatorx&immediate=true` 现在会直接使 OperatorX 的 CDN 标签过期,而不是仅标记为过时。
This comment has been minimized.
This comment has been minimized.
…e clicking Firefox E2E hung six times in a row on one AVIF optimization of a blog figure; WebP keeps most of the savings without the AVIF encoder. The coach-mark overlay test now waits for the overlay legend row and the chart redraw at its final width, since official points now draw before overlay data arrives. 中文: fix(images,e2e):图片仅输出 WebP,并在点击前等待叠加图表就绪 Firefox E2E 在一张博客配图的 AVIF 优化上连续六次卡住;WebP 保留了大部分 体积收益,且不依赖 AVIF 编码器。由于官方数据点现在会先于叠加数据绘制, coach-mark 叠加测试改为等待叠加图例行出现、图表按最终宽度重绘后再点击。
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a70fac2. Configure here.
| const drawnWidth = Number($svg.attr('width')); | ||
| const availableWidth = $svg.parent()[0].getBoundingClientRect().width; | ||
| expect(Math.abs(drawnWidth - availableWidth)).to.be.lessThan(1); | ||
| }); |
There was a problem hiding this comment.
Chart width wait never settles
Medium Severity
The new overlay wait reads Number of the chart SVG width attribute and compares it to the parent box. That SVG is rendered with width="100%", so the conversion is NaN and the assertion cannot pass. Cypress keeps retrying until the test times out, so unofficial overlay points are never clicked.
Reviewed by Cursor Bugbot for commit a70fac2. Configure here.
Matches purgeAll's order so a refresh racing the purge cannot recache retracted OperatorX comparisons from blobs that are about to be deleted. 中文: fix(cache):先删除 OperatorX blob,再使其 CDN 标签过期 与 purgeAll 的顺序一致,避免清除过程中触发的刷新从即将删除的 blob 中重新缓存 已撤回的 OperatorX 对比数据。
This comment has been minimized.
This comment has been minimized.
Next 16.3.3 reads local source images through a mocked request that reuses the browser's socket. When the browser cancels early, the file read is dropped, the mock never finishes, and every later request for that image variant waits forever on the shared optimization. Blog figures now go through the optimizer, so Firefox E2E hit this when a resize cancelled a srcset fetch. Patch it via bun patchedDependencies, guard the patch with a test, and include patches/ in the CI path filters. 中文: fix(next):修复请求取消后图片优化器卡住的问题 Next 16.3.3 通过复用浏览器 socket 的模拟请求读取本地源图片。浏览器过早取消 请求时,文件读取被丢弃,模拟请求永远不会完成,之后对同一图片变体的所有请求 都会一直等待这次共享的优化。博客配图现在经过图片优化器,Firefox E2E 在调整 窗口大小取消 srcset 请求时触发了该问题。通过 bun patchedDependencies 打补丁, 用测试守护补丁,并将 patches/ 加入 CI 路径过滤。
中文:将 origin/master 合并到 fix/seo-perf-audit


Summary
The compare, per-dollar, precision, spec-decode, run, rankings and overview pages were
force-dynamic. Every request was ano-storecache miss rendered against the DB, and compare HTML reached 1.45 MB because each page inlined every sequence's benchmark rows. Its title, description and canonical arrived in the body about 1 MB in. These pages are most of the sitemap and the slowest routes in field data. Dashboards also loaded their data in a client waterfall, and browsers could not reuse API responses (max-age=0, no ETag, gzip only). Several metadata gaps kept pages from showing good search and social previews.This PR fixes those and the related issues found in a site-wide audit.
Indexing and metadata
og:imageand asummary_large_imagecard through onesocialMetadatahelper. Before, about a third of sitemap URLs had no image./inferenceis self-canonical and listed in the sitemap. It previously canonicalized to/. The root-level canonical is removed.| InferenceXsuffix. Descriptions are capped at 155 characters in EN and 120 in ZH.description,licenseandcreator.lastmoddates, and revalidates hourly./agentx/<unknown>now returns 404./zhresponses sendContent-Language: zh-CN.Rendering and caching
revalidate = 3600, withgenerateStaticParamsreturning[]so nothing is prebuilt. They no longer readsearchParamson the server.Vary: Accept-Encoding, and return a strong ETag with 304 support. Browsermax-ageis 60 s. CDNs-maxageis unchanged.db-pagecache tag lets ISR regeneration refetch fresh data without the next visitor blocking.purgeAll({ immediate })and/api/v1/invalidate?immediate=truehard-purge for corrections.apply-run-overrides.ymlandcache-refresh.ymluse it.log-availability400 on models with more than 500 ids.Client performance
HardwareChartis lazy-loaded).next/imagewith recorded dimensions fromsrc/lib/blog/figure-dimensions.json. Regenerate it withbun run blog:figure-dimensions. Optimized images are WebP (Next's default format).proxy.tsgets a matcher./api/croncron is removed.Layout shift and UX
Analytics
$pageview. Overview and profit-estimator filter changes no longer do./ingestrewrite.outbound_link_clicked,not_found_page_shown, andinference_chart_rendered(time since navigation).route_templateandlocale.VisitTrackeris removed.Risks and things to watch
unstable_cacheandrevalidateTag(tag, 'max')semantics. The page/route split incachedQueryimports an internal path (next/dist/.../work-async-storage.external) that may move on Next upgrades.Vary: Accept-Encoding, a strong ETag, and 304s served from a CDN HIT. Two things are still unconfirmed because previews sit behind Vercel auth: whether a gzip-only client can receive a cached brotli variant, and whetherPragma: no-cacheforces revalidation./zh/modelpages.next buildcompiles and typechecks locally, but page-data collection needs DB credentials, the same as onmaster. The full build runs on the Vercel preview.patches/[email protected](rootpatchedDependencies) fixes a bug in Next's self-hosted image optimizer. Next reads local source images through a mocked request that reuses the browser socket. If the browser cancels early, that read never finishes, and every later request for the same image variant hangs until restart. Blog figures now go through the optimizer, so Firefox E2E hit this. Production on Vercel uses Vercel's image service and should be unaffected, though that is not verified.next-image-optimizer-patch.test.tsfails if a Next upgrade drops the patch.E2E_FIXTURES=1) sendCache-Control: no-storeon API responses so Cypress intercepts see every request. The 60 s browser reuse and ETag/304 path is covered only by unit tests and the preview check.Validation details
Smoke run against the Vercel preview of this branch (signed-in browser, since previews require Vercel auth):
/sitemap.xmlhas 3,046 URLs, including/inferenceand the explorer sections.<head>,og:image,twitter:card=summary_large_imageand exactly one h1./inferenceis self-canonical./zhpages sendContent-Language: zh-CN.x-vercel-cache: MISSon first request andHITon repeat./api/v1/availabilityreturnscontent-encoding: br, a strong ETag,Vary: Accept-Encoding, and 304 for a matchingIf-None-Match, served from a CDN HIT./agentx/does-not-existreturns 404. Dead URLs (/media,/ubenchx,/run/glm-5-2-on-b300) 308 to live pages./whitepaperno longer gets the asset cache header./about/,/zh/,/zh/blog/) 308 to the slashless URL. This smoke run caught a Vercel-only redirect loop, now fixed and covered by a test that compiles the redirects with@vercel/routing-utils.AI model disclosure
anthropic/claude-opus-5-5(runtime-exposed identifier for the coordinating agent).PR checklist
inferencex-skillschanges. No filters or views were added or removed. API caching and invalidate changes are documented inapi-documentation.ts, the route catalog anddocs/architecture.md./zhsiblingdocs/chinese-copy.md. New ZH metadata, intro and legend copy needs Chinese maintainer review.中文
概要
compare、per-dollar、precision、spec-decode、run、rankings 与 overview 页面此前均为
force-dynamic,每次请求都会未命中缓存(no-store)并实时查询数据库。对比页把所有序列的 benchmark 数据内嵌进 HTML,体积最高达 1.45 MB,标题、描述与 canonical 出现在正文约 1 MB 处。这些页面占 sitemap 的大部分,也是真实用户数据中最慢的路由。Dashboard 的数据以客户端瀑布方式加载,API 响应无法被浏览器缓存(max-age=0、无 ETag、仅 gzip)。此外还有若干元数据缺失,影响搜索与社交分享预览。本 PR 修复了全站审计中发现的这些问题及相关问题。索引与元数据
socialMetadata输出og:image与summary_large_image卡片(此前约三分之一的 sitemap URL 没有图片)。/inference改为自引用 canonical 并加入 sitemap(此前指向/),并移除根布局级 canonical。| InferenceX后缀前不超过 47 字符;描述英文不超过 155、中文不超过 120 字符。description、license、creator。lastmod并每小时重新生成。/agentx/<未知 slug>返回 404。/zh响应返回Content-Language: zh-CN。渲染与缓存
revalidate = 3600,generateStaticParams返回[],构建时不预渲染),服务端不再读取searchParams。Vary: Accept-Encoding、强 ETag 与 304,浏览器max-age为 60 秒,CDNs-maxage不变。db-page缓存标签,ISR 重新生成时拉取新数据,访问者无需等待。purgeAll({ immediate })与/api/v1/invalidate?immediate=true立即清除,apply-run-overrides.yml与cache-refresh.yml已使用该模式。log-availability返回 400 的问题。前端性能
HardwareChart改为懒加载)。next/image,尺寸来自src/lib/blog/figure-dimensions.json(用bun run blog:figure-dimensions重新生成)。优化后的图片输出 WebP(Next 默认格式)。proxy.ts增加 matcher。/api/cron定时任务。布局偏移与交互
统计
$pageview,overview 与 profit-estimator 的筛选变化不再记录。/ingest转发。outbound_link_clicked、not_found_page_shown与inference_chart_rendered(自导航开始的耗时)事件。route_template与locale。VisitTracker。风险与注意事项
unstable_cache与revalidateTag(tag, 'max')的语义;cachedQuery的页面/路由区分引用了 Next 内部路径(next/dist/.../work-async-storage.external),升级 Next 时可能变动。Vary: Accept-Encoding、强 ETag,并能从 CDN 命中返回 304。由于 preview 需要 Vercel 登录,仍有两点未确认:仅支持 gzip 的客户端是否可能拿到缓存的 brotli 版本,以及Pragma: no-cache是否会强制重新验证。/zh/model页面中仍为英文的正文。next build可完成编译与类型检查,但收集页面数据需要数据库凭据(与master相同);完整构建在 Vercel preview 上进行。patches/[email protected](根目录patchedDependencies)修复 Next 自托管图片优化器的缺陷:Next 通过复用浏览器 socket 的模拟请求读取本地源图片,浏览器过早取消时读取永远不会完成,之后对同一图片变体的请求会一直卡住直到重启。博客配图现在经过图片优化器,Firefox E2E 因此触发了该问题。Vercel 生产环境使用 Vercel 自身的图片服务,预计不受影响(尚未验证)。next-image-optimizer-patch.test.ts会在 Next 升级丢失补丁时失败。E2E_FIXTURES=1)对 API 响应返回Cache-Control: no-store,以便 Cypress 拦截每个请求;60 秒浏览器缓存与 ETag/304 仅由单元测试与 preview 检查覆盖。验证
/inference与 explorer 分区);抽查的 17 个中英文页面均返回 200,canonical 位于<head>内,带og:image、summary_large_image与唯一的 h1;/zh返回Content-Language: zh-CN。/api/v1/availability返回 brotli、强 ETag、Vary: Accept-Encoding,并能从 CDN 命中返回 304。/agentx/不存在的 slug返回 404;失效 URL 以 308 跳转到现有页面;带尾部斜杠的 URL 以 308 跳转到无斜杠版本(冒烟检查发现了一个仅在 Vercel 上出现的跳转死循环,已修复并用@vercel/routing-utils编译跳转规则进行测试)。AI 模型使用说明
anthropic/claude-opus-5-5(运行环境提供的标识),负责全站审计、规划与整合改动、修复类型与构建问题,以及撰写提交信息与 PR 文本。Note
Medium Risk
Wide changes to ISR, CDN invalidation, and API caching determine whether stale or retracted benchmark data can be served; the Next.js patch and internal
unstable_cache/revalidateTagusage need careful verification on deploy and upgrades.Overview
Turns compare, run, rankings, overview, and related programmatic routes from always-dynamic, no-store renders into hourly ISR with smaller compare payloads (default sequence only) and client/API loading for the rest. API routes now negotiate encoding, emit strong ETags with 304 support, and use
Cache-Controlsuited to browser reuse; ingest uses stale-while-revalidate by default plus adb-pagetag so ISR can refresh without blocking visitors, while--immediate/?immediate=truehard-purges for retractions and overrides.CI and ops wire
admin:cache:invalidate … --immediate, post-ingestadmin:cache:warmup --dashboard, and a broader warm-after-deploy job (dashboard APIs, top pages, OperatorX). CollectiveX deletion triggers immediate scoped purge.SEO and metadata consolidate social tags via
socialMetadata, tighten title/description limits, fix/inferencecanonical/sitemap behavior, addContent-Languagefor/zh, and move many redirects/cache headers intonext.config.ts(including PostHog/ingestrewrites). English dashboard tabs gain serverTabIntroblocks like Chinese.Blog figures move to
next/imagewith ablog:figure-dimensionsmanifest; docs and skills tell authors to regenerate it. Apatches/[email protected]fixes self-hosted image optimizer hangs when the browser cancels early.Analytics behavior is documented and adjusted (virtual pageviews on pathname changes, not filter-only updates; first-party ingest; safer search/replay masking). ChartLegend explains blocked hardware toggles for a11y. E2E and workflow path filters include
patches/**.Reviewed by Cursor Bugbot for commit e112041. Bugbot is set up for automated code reviews on this repo. Configure here.