Repository navigation
Add c15t to tanstack.com - #1364
KayleeWilliams wants to merge 2 commits into
Conversation
Loaders and server functions set Cache-Control on the whole response. getOSSStats sets "public, max-age=300, stale-while-revalidate=3600", so any page that loads stats, including the homepage, told browsers and proxies they could reuse its HTML for 5 minutes and serve it stale for up to an hour. That was harmless while every visitor got the same HTML. With the consent banner, the server renders the visitor's own consent state from their c15t cookie: whether to show the banner, their recorded choices and their subject ID. A visitor who accepted and opened the homepage in a new tab got the cached pre-choice HTML from the browser's disk cache, so the banner came back until c15t re-read the cookie on the next focus. A shared cache could hand one visitor's consent state to another. The hosting layer now sets "Cache-Control: private, no-cache" on every HTML response and drops Cloudflare-CDN-Cache-Control. Browsers still keep the page, but revalidate it on each visit. JSON, images and other non-HTML responses keep the headers their routes set.
Add a c15t consent banner and hold Google Analytics, NameThatHost, Scarf and video embeds until the visitor chooses. Sentry strips user data until Analytics is allowed. Self-host fonts so Google Fonts no longer sees each visitor's IP before a choice.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Visitors now choose what tanstack.com measures. Google Analytics, NameThatHost, Scarf and YouTube or Vimeo embeds wait for that choice. The banner comes in the server HTML, so it shows in the first frame and does not move the page.
c15t runs the banner and the consent records. The policy and the stored choices live in Inth, at
tanstack-tanstack.inth.app.Videos
Homepage bar on a large window. The bar covers the stats strip under the hero. When you scroll, it stops under the navbar until you choose.
sticky-bar-dark.mp4
sticky-bar-light.mp4
All window sizes. The homepage at 16 sizes from 390 × 844 to 3840 × 2160, then the floating banner on
/blogat 5 sizes.Too large will update later
What changes
Consent
ConsentRootinsrc/routes/__root.tsxholds the visitor's consent state. The root loader gets that state on the server.consentManifest()invite.config.tsputs the Inth policy into the server build. The server does not ask Inth for the policy on each page. After a policy change in Inth, rebuild the site.variant="bar"). All other pages show c15t's floating card.Scripts that wait for consent
gtaghelper. It still goes through the/_aproxy. Page views from before the choice stay in a queue. They go out only if the visitor accepts.src/router.tsxfor all visitors, so it still catches hydration errors. Until a visitor allows Analytics, c15t removes user data, IP addresses and session IDs from the reports.Fonts
public/fonts. Before, Google Fonts got each visitor's IP address before any choice.public/_headerscaches/fonts/*for one year. If a font file changes, give it a new name.Other
@sentry/*goes from 10.47 to 10.76.1. The c15t integration for Sentry needs 10.67 or later.src/utils/analytics/events.tsis nowregistry.ts. Lists in tracker blockers match the dev module URL/analytics/events.ts. With a blocker on, the page did not hydrate in dev.@c15t/tanstack-start/serverentry. Thebrowserexport condition gives the Worker a stub that throws.Performance
Lab test, median of 7 runs, base commit
862ccc3dagainst this branch. Mobile is 412 × 823 with the CPU slowed 4× on a 1.6 Mbps link with 150 ms latency. Desktop is 1350 × 940 with no throttle./, LCP/, Total Blocking Time/, banner paint/, Reject All response (INP)/, LCP/, Reject All response (INP)Checks
pnpm test/blogat 5, in light and dark mode