The-DevOps-Daily / The-DevOps-Daily/devops-daily

Cloudflare Pages file-count headroom (approaching the ~20k limit)

Open
#1,422 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.1k
Forks
392
Avg merge
5h 8m
Merged PRs (30d)
121

Description

Cloudflare Pages caps a deployment at ~20,000 files. As of 2026-06-27 we deploy 18,326 files, so headroom is limited and grows with every new content item. Tracking the analysis and levers here for when we need them.

Done so far
  • #1421 pruned ~934 intermediate OG-source SVGs (deploy 19,260 → 18,326) and made web image resolution prefer PNG (lib/image-utils.ts).
  • Paused the daily auto-content generation to stop the count creeping up (the weekly digest is kept).
Rough breakdown of the ~18.3k
  • ~1,670 HTML pages (one per post/tag/quiz/comparison/game/etc., trailingSlash: false)
  • ~518 .md copies (AI-readable post/advent routes)
  • ~1,231 images (1,082 png + 132 svg)
  • ~15k _next/ JS/CSS chunks — the bulk, currently unconfirmed
Confirm the _next bulk

Run on a built out/:

find out -type f | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20
Levers, ranked
  1. Threshold tag pages. 669 tags exist; 433 have only a single post. Generate only tags with ≥2 posts (~-433 pages). Filter centrally in lib/tags.ts so the [tag] generateStaticParams and the tag chips use the same filtered set (no broken links).
  2. Offload images to Cloudflare R2 (~-1,231). Biggest single win; R2 is on Cloudflare so no egress, edge-cached. Rewrite image URLs + drop public/images.
  3. Reconsider the .md copies (~-518) if the AI-readable routes aren't pulling weight.
  4. Investigate the _next/ chunk count once the diagnostic above is run (likely per-route chunks from the 45 interactive game/simulator components).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by building out/ and running the listed find command to confirm how much of the deployment is in _next/ chunks. Then read lib/tags.ts and the [tag] generateStaticParams and tag-chip usage to assess the threshold-page option. The issue needs an agreed lever and acceptance criteria before completion can be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.