Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
import compression from 'compression';
import { constants } from 'node:zlib';
const isStreamingType = (contentType = '') => /^(?:text\/event-stream|application\/x-ndjson|multipart\/x-mixed-replace)(?:\s*;|$)/i.test(contentType);
export const httpCompression = compression({
threshold: 1024,
brotli: { params: { [constants.BROTLI_PARAM_QUALITY]: 4 } },
level: 6,
filter(req, res) {
if (req.headers.range || res.getHeader('Content-Encoding')) return false;
if (/(?:^|,)\s*no-transform\s*(?:,|$)/i.test(res.getHeader('Cache-Control') || '')) return false;
if (isStreamingType(res.getHeader('Content-Type'))) return false;
return compression.filter(req, res);
},
});