Make pages load fast on mobile
- Compress responses: page scripts and styles once (brotli or gzip, in memory) and cached immutable; pages and API JSON gzipped as they stream - Service worker serves content-named assets cache-first - Load the models modal's data when it opens (cached in localStorage) instead of shipping the model catalog in every conversation page - Lazy-load the Tiptap composer and memoize thread messages - Import lucide icons directly; twui 0.1.4 drops by-name icons from Button - bun run start builds the pages minified before serving Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+4
-1
@@ -11,6 +11,7 @@ import liveRelay from "./live-relay";
|
||||
import enableForeignKeys from "./functions/backend/db/enable-foreign-keys";
|
||||
import handleComputerProxy from "./functions/server/computers/handle-computer-proxy";
|
||||
import handlePwaFile from "./functions/server/pwa/handle-pwa-file";
|
||||
import compressResponse from "./functions/server/compress-response";
|
||||
import serveLocalCa from "./functions/server/serve-local-ca";
|
||||
import startHttpRedirect from "./functions/server/start-http-redirect";
|
||||
import resolveTlsOptions from "./utils/resolve-tls-options";
|
||||
@@ -147,7 +148,9 @@ const server = Bun.serve({
|
||||
return;
|
||||
}
|
||||
|
||||
return await bunext.bunextRequestHandler({ req, server });
|
||||
const response = await bunext.bunextRequestHandler({ req, server });
|
||||
|
||||
return response ? await compressResponse({ req, response }) : response;
|
||||
} catch (error: any) {
|
||||
await logError({
|
||||
title: "Unhandled request error",
|
||||
|
||||
Reference in New Issue
Block a user