fix(seo): correct canonical URLs, compress oversized images, add cache headers#4168
fix(seo): correct canonical URLs, compress oversized images, add cache headers#4168emir-karabeg merged 2 commits intostagingfrom
Conversation
…e headers - Replace all hardcoded https://sim.ai with https://www.sim.ai via SITE_URL constant - Migrate models, integrations, and homepage metadata from getBaseUrl() to SITE_URL - Compress 6 blog/landing images from 2.6MB to 300KB total - Convert mothership cover from PNG to JPEG (1.1MB → 99KB) - Add Cache-Control headers for static assets (1d max-age, 7d stale-while-revalidate) - Add SEO regression test scanning all public pages for canonical URL violations
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds a Vitest regression test ( Reviewed by Cursor Bugbot for commit 7d60d5e. Configure here. |
Greptile SummaryThis PR fixes canonical URL mismatches ( Confidence Score: 5/5Safe to merge — all remaining findings are P2 style suggestions with no correctness or security impact. The PR is a thorough, well-executed SEO fix. SITE_URL is correctly introduced and applied across every affected file. The only finding is a P2 precision nit on the Cache-Control source glob pattern (missing escaped dot), which has no practical security impact given that authenticated file-serving routes always set their own Cache-Control headers explicitly. apps/sim/next.config.ts — minor glob pattern precision for the Cache-Control source rule. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[lib/core/utils/urls.ts\nSITE_URL = 'https://www.sim.ai'] --> B[Metadata / metadataBase]
A --> C[JSON-LD structured data\n@id, url, breadcrumbs]
A --> D[Open Graph / alternates\ncanonical, og:url]
A --> E[RSS & Sitemap feeds\nchannel link, loc]
A --> F[next.config.ts\nredirects to www.sim.ai]
B --> G[Next.js pages\nlayout.tsx, page.tsx]
C --> H[structured-data.tsx\nblog/seo.ts]
D --> I[blog / integrations\nmodels / partners pages]
E --> J[rss.xml/route.ts\nsitemap-images.xml]
K[Cache-Control headers\nnext.config.ts] --> L[Static assets\n.svg .jpg .png .woff etc.\nmax-age=86400 / swr=604800]
M[seo.test.ts\nregression test] --> N{Scans SEO dirs}
N --> O[Assert: no bare https://sim.ai]
N --> P[Assert: no getBaseUrl in metadata]
N --> Q[Assert: SITE_URL = https://www.sim.ai]
Reviews (2): Last reviewed commit: "fix(seo): replace hardcoded URLs with SI..." | Re-trigger Greptile |
| line.includes('"https://sim.ai/') || | ||
| line.includes('`https://sim.ai/') || | ||
| line.includes('`https://sim.ai`') || | ||
| line.includes('canonical: https://sim.ai/') |
There was a problem hiding this comment.
SEO test misses bare URLs in MDX links
Low Severity
The regression test scans .mdx files for hardcoded https://sim.ai but only checks for URLs enclosed in JS quotes, backticks, or YAML canonical: prefix. It misses Markdown link syntax like (https://sim.ai) and bare URLs in template-literal XML. Three existing blog posts contain (https://sim.ai) in body content, demonstrating the blind spot is already producing false negatives on the first run.
Reviewed by Cursor Bugbot for commit 67a91e4. Configure here.
- Replace hardcoded https://www.sim.ai with SITE_URL in academy, changelog.xml, and whitelabeling - Broaden getBaseUrl() detection in SEO test to match any variable name assignment - Add ee/whitelabeling/metadata.ts to SEO test scan scope
|
@cursor review |
|
@greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7d60d5e. Configure here.


Summary
https://sim.ai→https://www.sim.aiCache-Controlheaders for static assetsContext
A third-party SEO audit flagged three issues: wrong canonical URLs making pages unindexable, oversized images (up to 1.1MB), and poor Core Web Vitals. This PR addresses all three.
Changes
Canonical URLs
SITE_URLconstant (https://www.sim.ai) tolib/core/utils/urls.tshttps://sim.aireferences across 30+ files (layouts, pages, blog frontmatter, JSON-LD, RSS feeds, redirects)getBaseUrl()toSITE_URLImage Compression
mothership/cover: 1,122KB → 99KB (converted PNG → JPEG for photographic content)v0-5/cover.png: 282KB → 66KBexecutor/cover.png: 184KB → 81KBseries-a/cover.png: 123KB → 26KBworkflow.png: 109KB → 31KBmultiplayer-cover.png: 784KB → 18KBPerformance
Cache-Control: public, max-age=86400, stale-while-revalidate=604800for static assets (images, fonts, icons)Regression Test
seo.test.tsscans all public-facing directories for:https://sim.aiwithoutwwwgetBaseUrl()used in page metadata (should useSITE_URL)SITE_URLconstant value correctnessType of Change
Testing
Checklist