Skip to content

Improve performance, fix compression bugs, harden stats API - #4

Merged
HapticHash merged 1 commit into
masterfrom
claude/capabilities-discussion-hrjot1
Sep 24, 2026
Merged

HapticHash merged 1 commit into
masterfrom
claude/capabilities-discussion-hrjot1

Conversation

@HapticHash

Copy link
Copy Markdown
Owner

Performance

  • Load FFmpeg (~31 MB) only once a video/audio file is added, not on page load
  • Lazy-load pdf.js, pdf-lib, JSZip, image and SVG compressors per file type;
    main bundle drops from 1.39 MB (476 KB gzip) to 354 KB (112 KB gzip)
  • Compress up to 3 files in parallel; FFmpeg jobs are serialized
  • Batch progress updates to one render per frame; memoize file rows
  • Zip with STORE instead of re-deflating already-compressed media
  • Render PDF pages via canvas.toBlob, free canvases/pages, small thumbnails
  • Replace large blur filters with gradients, drop per-row backdrop blur
  • Load fonts from index.html with preconnect, only weights 300-700
  • Long-lived cache headers for hashed /assets

Fixes

  • PDF output pages kept their scaled size (2x on Low); keep original size
  • FFmpeg progress listeners were never removed
  • Keep the original when compression doesn't make a file smaller
  • Downloads use the real output extension (.mov -> .mp4, .wav -> .mp3)
  • Real SVG optimization via SVGO; GIFs and unknown types are marked
    unsupported instead of showing fake progress
  • Validate the Custom target; estimate savings per file
  • Use the pdf.js legacy build, which polyfills Map.getOrInsertComputed;
    PDF compression failed in current browsers without it
  • Video: veryfast preset, AAC audio, faststart, bitrate from duration for
    Custom targets, downscale on Extreme
  • Drag-leave flicker, stale file list in async handlers, unique IDs,
    delayed object URL revocation, accessibility labels

Backend

  • Validate stats POST input; store totals in one KV key (1 write per report)
  • Client reports once per batch; stats GET is cached for 60 s
  • Health check on tab focus instead of every 30 s

Cleanup

  • Remove unused deps (genai, express, sqlite, dotenv...) and the Gemini key
    define; move build tools to devDependencies
  • Add unit tests (vitest) and a CI workflow
  • Remove .DS_Store and gitignore.txt; move README screenshots to docs/

Claude-Session: https://claude.ai/code/session_011UUBS4XF57trCnZcGwBu35

Performance
- Load FFmpeg (~31 MB) only once a video/audio file is added, not on page load
- Lazy-load pdf.js, pdf-lib, JSZip, image and SVG compressors per file type;
  main bundle drops from 1.39 MB (476 KB gzip) to 354 KB (112 KB gzip)
- Compress up to 3 files in parallel; FFmpeg jobs are serialized
- Batch progress updates to one render per frame; memoize file rows
- Zip with STORE instead of re-deflating already-compressed media
- Render PDF pages via canvas.toBlob, free canvases/pages, small thumbnails
- Replace large blur filters with gradients, drop per-row backdrop blur
- Load fonts from index.html with preconnect, only weights 300-700
- Long-lived cache headers for hashed /assets

Fixes
- PDF output pages kept their scaled size (2x on Low); keep original size
- FFmpeg progress listeners were never removed
- Keep the original when compression doesn't make a file smaller
- Downloads use the real output extension (.mov -> .mp4, .wav -> .mp3)
- Real SVG optimization via SVGO; GIFs and unknown types are marked
  unsupported instead of showing fake progress
- Validate the Custom target; estimate savings per file
- Use the pdf.js legacy build, which polyfills Map.getOrInsertComputed;
  PDF compression failed in current browsers without it
- Video: veryfast preset, AAC audio, faststart, bitrate from duration for
  Custom targets, downscale on Extreme
- Drag-leave flicker, stale file list in async handlers, unique IDs,
  delayed object URL revocation, accessibility labels

Backend
- Validate stats POST input; store totals in one KV key (1 write per report)
- Client reports once per batch; stats GET is cached for 60 s
- Health check on tab focus instead of every 30 s

Cleanup
- Remove unused deps (genai, express, sqlite, dotenv...) and the Gemini key
  define; move build tools to devDependencies
- Add unit tests (vitest) and a CI workflow
- Remove .DS_Store and gitignore.txt; move README screenshots to docs/

Claude-Session: https://claude.ai/code/session_011UUBS4XF57trCnZcGwBu35
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
compressly af8c24e Sep 24 2026, 08:42 PM

@HapticHash
HapticHash merged commit ca84187 into master Sep 24, 2026
2 of 3 checks passed
@HapticHash
HapticHash deleted the claude/capabilities-discussion-hrjot1 branch September 24, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant