Skip to content

Replace startup compression with memory-serve#623

Merged
meawoppl merged 1 commit intomainfrom
meawoppl/memory-serve
Apr 5, 2026
Merged

Replace startup compression with memory-serve#623
meawoppl merged 1 commit intomainfrom
meawoppl/memory-serve

Conversation

@meawoppl
Copy link
Copy Markdown
Owner

@meawoppl meawoppl commented Apr 5, 2026

Summary

  • Replace rust-embed + manual brotli/gzip startup compression with memory-serve
  • Assets are now compressed at build time (brotli in release builds), not at server startup
  • Eliminates the ~40s CPU spike on startup that was destabilizing shared hosts (Startup brotli compression pegs CPU for ~40s, can destabilize shared host #613)
  • Removes rust-embed, brotli, flate2, mime_guess dependencies
  • Deletes embedded_assets.rs (138 lines) — replaced by 6 lines of memory-serve config
  • Built-in ETag/304, content negotiation, SPA fallback, cache-control headers

Closes #613

Test plan

  • Backend starts instantly (no compression delay)
  • Frontend loads at http://localhost:3000/
  • SPA routing works (e.g. /dashboard returns index.html with 200)
  • Assets have correct Content-Encoding headers (brotli/gzip in release)
  • Cache-Control: no-cache on index.html, immutable on hashed assets

@meawoppl meawoppl merged commit 88b73cb into main Apr 5, 2026
16 checks passed
@meawoppl meawoppl deleted the meawoppl/memory-serve branch April 5, 2026 19:51
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.

Startup brotli compression pegs CPU for ~40s, can destabilize shared host

1 participant