René's URL Explorer Experiment


Title: perf: make published pages lighter and faster to load by ysamcode · Pull Request #683 · ycode/ycode · GitHub

Open Graph Title: perf: make published pages lighter and faster to load by ysamcode · Pull Request #683 · ycode/ycode

X Title: perf: make published pages lighter and faster to load by ysamcode · Pull Request #683 · ycode/ycode

Description: Summary Published pages were sending the same content more than once on every view: the page's CSS twice (once in the markup, once in the hydration data) and the site's 404 page on pages that exist. This removes both, so pages are lighter and the CSS is cached by the browser. Changes Link page CSS larger than 8 KB as a stylesheet at /api/page-css/{pageId}/{hash}.css instead of inlining it; the URL is content-addressed, so it is cached for a year Serve the current CSS with a 60 second cache when the hash is stale, so HTML cached from an older publish is never unstyled Keep previews, drafts and small stylesheets inline Render nothing from the 404 boundary of the published route when the requested page exists, so the 404 page no longer ships with every page Move the published page loaders to lib/published-page-data.ts so the page and the 404 boundary share one cached lookup Measured on a production build of a local site: a page with 56 KB of CSS went from 1,260 KB to 1,129 KB of HTML, the homepage (9 KB of CSS) from 1,266 KB to 1,230 KB. Notes: The pagination route (/dynamic) gets the linked stylesheet but still carries the 404 page React keeps a linked stylesheet in the document after a client-side navigation. Published pages link with plain tags, so this does not happen today; it needs handling before client-side navigation between published pages is added Without a CDN, each new visitor's stylesheet request reaches the server once; after that the browser caches it Test plan Open a published page with more than 8 KB of CSS: it is styled, the HTML has a and no inline copy of the CSS Request the stylesheet URL: 200 with Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable Change the hash in the URL: 200 with a 60 second cache; a malformed page id or hash returns 404 Publish a style change: the page links a new stylesheet URL and shows the change Open a preview and a page with little CSS: styles are still inline Open a missing URL, including under a locale prefix: 404 status and the 404 page in the right language View source of an existing page on a site with a custom 404 page: no 404 content in it Open a password-protected page: the password page is styled Open a paginated collection page (?p_…): it is styled Run npm run build and npm test

Open Graph Description: Summary Published pages were sending the same content more than once on every view: the page's CSS twice (once in the markup, once in the hydration data) and the site's 404 page on pages th...

X Description: Summary Published pages were sending the same content more than once on every view: the page's CSS twice (once in the markup, once in the hydration data) and the site's 404 page on ...

Opengraph URL: https://github.com/ycode/ycode/pull/683

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ef63d94f-49cf-43f9-92f9-0486b48153bd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA7B6:3A8F3:103BAB:153668:6AFE340B
html-safe-nonce6d3e863df4b90d5a1b1b5e9073dd5e4863d77db7da42e9f243e6cfba769f282f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0I2OjNBOEYzOjEwM0JBQjoxNTM2Njg6NkFGRTM0MEIiLCJ2aXNpdG9yX2lkIjoiNDc1MTM2MTg1Mjc5MTczMTIxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac78b36d048e2d3946fe1c0b9e2738b4c6c0331b4fb4bf127c6235bfaf01abf4f6
hovercard-subject-tagpull_request:5300021194
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/ycode/ycode/pull/683/files
twitter:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/7631193?s=400&v=4
og:image:altSummary Published pages were sending the same content more than once on every view: the page's CSS twice (once in the markup, once in the hydration data) and the site's 404 page on pages th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned70e31220a67f6376c108d2416fa8e7df854c1065b1672ab7a88ab6dc3a809e2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/ycode/ycode git https://github.com/ycode/ycode.git
octolytics-dimension-user_id65892203
octolytics-dimension-user_loginycode
octolytics-dimension-repository_id1165452593
octolytics-dimension-repository_nwoycode/ycode
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1165452593
octolytics-dimension-repository_network_root_nwoycode/ycode
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseccb88d9c92abe69245b429398c8a57ae87070c7c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/ycode/ycode/pull/683/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F683%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fycode%2Fycode%2Fpull%2F683%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=ycode%2Fycode
Reloadhttps://github.com/ycode/ycode/pull/683/files
Reloadhttps://github.com/ycode/ycode/pull/683/files
Reloadhttps://github.com/ycode/ycode/pull/683/files
ycodehttps://github.com/ycode
ycodehttps://github.com/ycode/ycode
Codehttps://github.com/ycode/ycode
Issues7 (7)https://github.com/ycode/ycode/issues
Pull requests1 (1)https://github.com/ycode/ycode/pulls
Discussionshttps://github.com/ycode/ycode/discussions
Actionshttps://github.com/ycode/ycode/actions
Projectshttps://github.com/ycode/ycode/projects
Security and quality1 (1)https://github.com/ycode/ycode/security
Insightshttps://github.com/ycode/ycode/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fycode%2Fycode%2Fissues%2Fnew%2Fchoose
ysamcodehttps://github.com/ysamcode
develophttps://github.com/ycode/ycode/tree/develop
perf/lighter-published-pageshttps://github.com/ycode/ycode/tree/perf/lighter-published-pages
Conversation 0 https://github.com/ycode/ycode/pull/683
Commits 2 https://github.com/ycode/ycode/pull/683/commits
Checks 0 https://github.com/ycode/ycode/pull/683/checks
Files changed https://github.com/ycode/ycode/pull/683/files
Please reload this pagehttps://github.com/ycode/ycode/pull/683/files
perf: make published pages lighter and faster to load https://github.com/ycode/ycode/pull/683/files#top
Show all changes 2 commits https://github.com/ycode/ycode/pull/683/files
1e0cd4b perf: serve page CSS as a cached stylesheet ysamcode Nov 13, 2026 https://github.com/ycode/ycode/pull/683/commits/1e0cd4be48e1f45b633f3f128bd96faff46ac1ba
7face6c perf: stop shipping the 404 page with every page ysamcode Nov 13, 2026 https://github.com/ycode/ycode/pull/683/commits/7face6cae4e6d66f2756da80d3fca6af7569d3a1
Clear filters https://github.com/ycode/ycode/pull/683/files
Please reload this pagehttps://github.com/ycode/ycode/pull/683/files
Please reload this pagehttps://github.com/ycode/ycode/pull/683/files
layout.tsx https://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
not-found.tsx https://github.com/ycode/ycode/pull/683/files#diff-adbf9edb8ecac1429aac922e08487f56ddb11dc170f94b5ebf75f997069f33aa
page.tsx https://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
route.ts https://github.com/ycode/ycode/pull/683/files#diff-b0e645e3d623bd1180fdc4a4e59c501f48ba6a5bf699d49b8a20d5fb34478c94
site.css https://github.com/ycode/ycode/pull/683/files#diff-8bc006b1faadd6c296489670edd3109c91c0356f9f31ae10c0e702a467d0b955
PageRenderer.tsx https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
page-css.test.ts https://github.com/ycode/ycode/pull/683/files#diff-d28e26705a0d4e15d0ce7a67462b8c789d7c4f7634cb19892751df7fa53c4b19
page-css.ts https://github.com/ycode/ycode/pull/683/files#diff-b7598baea72196710fb88ad7a8a34eefb4e27a9da65b3cca9916e280d6f29393
published-page-data.ts https://github.com/ycode/ycode/pull/683/files#diff-0e6069ac26b35fc3e6a4e8892e7fb495e02da4122ac13b231fb848cfe4fccb8c
pageLayersRepository.ts https://github.com/ycode/ycode/pull/683/files#diff-25ab3504f4bf5ea3a1454ea713c70df80e57da74e880d9fa3d77d197b304f079
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
app/(published)/[[...slug]]/layout.tsxhttps://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/app/(published)/%5B%5B...slug%5D%5D/layout.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
https://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
https://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
https://github.com/ycode/ycode/pull/683/files#diff-573d7afd2094ac27e26bcd692fc2d981232fa26a05adee1cd037f875531b0805
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
app/(published)/[[...slug]]/not-found.tsxhttps://github.com/ycode/ycode/pull/683/files#diff-adbf9edb8ecac1429aac922e08487f56ddb11dc170f94b5ebf75f997069f33aa
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/app/(published)/%5B%5B...slug%5D%5D/not-found.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
app/(published)/[[...slug]]/page.tsxhttps://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/app/(published)/%5B%5B...slug%5D%5D/page.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
https://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
https://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
https://github.com/ycode/ycode/pull/683/files#diff-ae00f697167abd297f3d01f20f5356df216bb83fae470d656015d535bfe28a11
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
app/(site)/api/page-css/[pageId]/[file]/route.tshttps://github.com/ycode/ycode/pull/683/files#diff-b0e645e3d623bd1180fdc4a4e59c501f48ba6a5bf699d49b8a20d5fb34478c94
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/app/(site)/api/page-css/%5BpageId%5D/%5Bfile%5D/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
app/site.csshttps://github.com/ycode/ycode/pull/683/files#diff-8bc006b1faadd6c296489670edd3109c91c0356f9f31ae10c0e702a467d0b955
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/app/site.css
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/683/files#diff-8bc006b1faadd6c296489670edd3109c91c0356f9f31ae10c0e702a467d0b955
https://github.com/ycode/ycode/pull/683/files#diff-8bc006b1faadd6c296489670edd3109c91c0356f9f31ae10c0e702a467d0b955
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
components/PageRenderer.tsxhttps://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/components/PageRenderer.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/pull/683/files#diff-fd744ab1e8621b1ead61c31be2c1ee564e0ec2f132090b9347bf922e9200e583
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/page-css.test.tshttps://github.com/ycode/ycode/pull/683/files#diff-d28e26705a0d4e15d0ce7a67462b8c789d7c4f7634cb19892751df7fa53c4b19
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/lib/page-css.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
https://github.com/ycode/ycode/blob/develop/.github/CODEOWNERS#L1
lib/page-css.tshttps://github.com/ycode/ycode/pull/683/files#diff-b7598baea72196710fb88ad7a8a34eefb4e27a9da65b3cca9916e280d6f29393
View file https://github.com/ycode/ycode/blob/7face6cae4e6d66f2756da80d3fca6af7569d3a1/lib/page-css.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/ycode/ycode/pull/683/{{ revealButtonHref }}
Please reload this pagehttps://github.com/ycode/ycode/pull/683/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.