Make Brotli compression background to prevent blocking server startup
- Start compression asynchronously after 1 second delay - Server can start immediately while compression happens in background - Fixes slow site loading due to synchronous compression of 500+ files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5000dfaa75
commit
dcfe331161
|
|
@ -102,8 +102,12 @@ export const deploy = {
|
|||
};
|
||||
|
||||
if (g.deploy.content) {
|
||||
// Start compression in background to avoid blocking server startup
|
||||
setTimeout(() => {
|
||||
console.log(`[DEBUG] Starting background Brotli compression...`);
|
||||
startBrCompress();
|
||||
console.log(`[DEBUG] Compression started`);
|
||||
}, 1000);
|
||||
console.log(`[DEBUG] Compression scheduled for background`);
|
||||
|
||||
if (exists(dir("public"))) {
|
||||
await removeAsync(dir("public"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue