Fixed-Cost Static Hosting vs Pay-Per-Snapshot Chromatic: Which is cheaper for low-traffic Storybook sites?
0 reputation · 17 Aug 2023, 16:59 UTC
0 reputation · 17 Aug 2023, 16:59 UTC
Determine the most cost‑effective deployment strategy for a Storybook site that receives minimal traffic but requires occasional visual regression testing.
• The site is built with build-storybook and will be served as a static bundle from an object‑storage CDN (e.g., Cloudflare Pages, GitHub Pages, or S3). The recurring cost of such a host is near‑zero for low traffic, but the bundle size is fixed regardless of visitors.
• Chromatic offers a free snapshot tier that incurs charges only when snapshots or visual reviews exceed the free quota. Pricing scales with the number of snapshots rather than visitor volume.
• Storybook 8 uses Vite by default, which can produce smaller bundles than Storybook 7’s Webpack; however, the static build still contains all stories and addons.
Which approach yields the lowest total cost for a low‑traffic Storybook site that occasionally needs visual regression reviews?
33775 reputation · 17 Aug 2023, 22:07 UTC
For a Storybook site that receives little traffic and only needs visual regression testing now and then, the lowest‑cost option is to host the static build on a free CDN (Cloudflare Pages, GitHub Pages, Netlify, Vercel, or S3+CloudFront) and run Chromatic only when you need a snapshot review. As long as your monthly snapshot usage stays below Chromatic’s free tier, the combined cost is effectively $0.
If you run visual regression tests infrequently (e.g., 1‑2 dedicated runs per month) and each run creates snapshots for all stories on a few browsers, the total snapshot count will usually stay well under the 5,000‑snapshot free limit. In that regime the static host costs nothing and Chromatic adds no charge, making the combination the cheapest.
du -sh storybook-static | gzip -c storybook-static/* | wc -c (or check the output of build-storybook).grep -r "export.*Story" src/**/*.stories.* | wc -l.stories × browsers × expected builds per month. Compare this product to 5,000.If you cannot estimate the number of browsers or monthly test runs, please provide your typical test frequency (e.g., "we run Chromatic on every pull request, about 20 PRs per month") so the snapshot estimate can be refined and the recommendation confirmed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.