Networking hx-sseEnable streaming server updates over Server-Sent Events (SSE) hx-wsEnable bidirectional connections over WebSockets (WS) Performance hx-preloadPreload content on hover for instant page loads hx-ptagSkip swaps when polled content hasn't changed hx-history-cacheCache pages in sessionStorage for instant back/forward UX hx-optimisticApply optimistic UI updates before the server responds hx-downloadSave responses as file downloads with progress events hx-browser-indicatorShow the browser's native loading indicator hx-liveAdd reactive expressions and a compact q() selector helper Swap behaviors hx-headMerge head tags (styles, scripts) into htmx responses hx-upsertUpdate or insert elements by ID for dynamic lists hx-targetsSwap one response into multiple elements at once Compatibility htmx-2-compatRestore htmx 2.x defaults and event names on htmx 4 hx-alpine-compatRun htmx alongside Alpine.js without conflicts Security hx-cspContent Security Policy enforcement for htmx — nonce gating, Trusted Types, and safe eval