Network optimization for the DSH web UI: reduces transfer size with caching and compression to greatly speed up page loading, plus a connection-drop indicator and automatic reconnection. Ideal for users pursuing peak performance or using unstable networks.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-web-network-optimizer
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:enterhalf/dsh-web-network-optimizer
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
中文 | English
⚠️ DEPRECATED — do not install on dsh ≥ 0.1.2
After DeepSeek Harness updated to the latest version (0.1.2-rc.1, npm
latestsince 2026-09), the official implementation now covers every feature of this plugin. This plugin is no longer needed and no longer maintained:
- Response compression —
@deepseek-ai/dsh-host-webserverships built-in gzip (profile configcompression: gzip, configurable level/threshold), identical behavior on local loopback and remote access;- Browser caching — plugin client bundles are no longer served per file; everything goes through the content-addressed combo delivery of
@deepseek-ai/dsh-client-modules(/plugins/??…&rev=<content-sha1>) withCache-Control: immutable: the URL is the content hash, an update always yields a newrev, and a mismatched revision is refused — the cache is always fresh and there is no "cache out of sync" blind spot;- Automatic reconnection — the official ConnectionController reconnects with exponential backoff and is offline-aware (
navigator.onLine), re-syncing data automatically after recovery.This plugin was built on the old architecture that predates those features (wrapping each webServer route table entry + per-file client-bundle delivery). On the new architecture it has nothing to wrap and actively conflicts — after this repo's main instance upgraded to 0.1.2-rc.1, installing it broke startup and it was disabled and removed. The plugin is only meaningful on dsh 0.1.x (≤ 0.1.1-rc.2);
package.jsonnow limits the allowed dsh versions throughpeerDependenciesto@deepseek-ai/dsh >=0.1.0-rc.2 <=0.1.1-rc.2, so package managers flag the incompatibility.Users already on dsh ≥ 0.1.2 should uninstall it:
dsh plugin --profile <name> remove dsh-web-network-optimizer.
dsh网页端网络优化:通过缓存与压缩技术降低传输,从而大幅提升网页加载速度;同时提供网络断连指示与自动断网重连功能。非常适合追求极致性能或网络不稳定用户使用。
Network optimization for the DSH web UI: reduces transfer size with caching and compression to greatly speed up page loading, plus a connection-drop indicator and automatic reconnection. Ideal for users pursuing peak performance or using unstable networks.
- Connection Guard — mobile carriers silently drop the network when the phone goes to the background, leaving the UI "permanently frozen": detected automatically, recovered within 1 second, with connection status shown as a small dot beside the conversation title (green = OK / gray = checking / red pulse = problem) and a manual forced reconnect on click;
- Response Compression — every compressible response is served as brotli with gzip as fallback, identical behavior on local loopback and remote access;
- Browser Caching —
/assets/*and the favicon are content-hashed by filename (an update always yields a new URL), so they are served withCache-Control: immutableand a second visit transfers almost nothing; pluginclient.js(rev=URLs) keepsno-cacheand the plugin adds an ETag — every load is a conditional revalidation: unchanged content gets a 304 (header bytes only), changed content is delivered fresh, near-zero traffic and always up to date; - Per-Plugin Traffic Ledger — the Settings → Web Network Optimizer panel shows, in real time, how much traffic each plugin uses per load and in total, how much compression saved, and cache-hit status;
- Cache Self-Check — when you suspect the browser cache has not caught up with an update, the panel offers three one-click-copyable DevTools steps for clearing the browser cache manually.
Measured Results
Full GUI load (87 static requests): first-load static traffic 8.1 MB → 1.54 MB (−81%), zero static transfer on a cache-hit second visit; largest API /api/session.list 2.18 MB → 144 KB (−93%).
Connection Guard
After the phone goes to the background, carriers often silently cut the TCP connection. The browser is frozen and never notices the drop: the WebSocket state stays OPEN, and the connection controller believes the connection is healthy. Back in the foreground: the UI still looks "alive", but all real-time data is dead — you cannot tell "it is not moving" from "my network dropped".
This plugin actively probes the real connection state when the page returns to the foreground (and on a 30-second heartbeat); when it finds the old connection is dead while the network and the server are both alive, the server destroys the old connection and the controller follows its existing reconnect logic. Recovery keeps the page's in-memory state intact — drafts, scroll position, and in-progress input all survive, and the frozen UI "comes back to life" on its own.
What you see
A small dot is always shown to the left of the conversation title — color is the status, hover expands the text:
| Dot | Meaning |
|---|---|
| 🟢 Green | Connection healthy |
| ⚪ Gray | Checking / reconnecting |
| 🔴 Red (pulsing) | Offline / problem / recovering |
| 🟢 Green ("recovered ✓") | Reconnect complete, returns to solid green after 5 seconds |
Clicking the dot = manual forced reconnect — whenever you suspect it is stuck, one click gives a definite result.
Installation
dsh plugin --profile web add dsh-web-network-optimizer@latest
Uninstall:
dsh plugin --profile web remove dsh-web-network-optimizer
Uninstalling restores the route wrapping completely; the ledger file is kept in ~/.dsh/storages/dsh-web-network-optimizer/ for review, and orphaned cache is reclaimed by the browser's own quota.
Cache semantics: /assets and the favicon rely on content-hashed filenames — on update, changed content → new filename → new URL, so the old cache is naturally invalidated and immutable is safe; plugin client.js uses no-cache + ETag — every load revalidates conditionally (304 if unchanged, fresh content otherwise), which does not depend on URL changes and eliminates the "cache out of sync" blind spot (immutable means the browser never requests again, so no server-side technique can keep up with file changes — it is therefore reserved for filename-hashed resources only).
Cache self-check: extreme cases (a misbehaving browser cache, a rewriting proxy, etc.) can still leave stale content behind. Browsers expose no JavaScript API to clear the HTTP cache, so the panel's Cache Self-Check section lists three one-click-copyable DevTools steps (right-click the reload button → "Empty Cache and Hard Reload" / Network panel → "Disable cache" / Application panel → "Clear site data") — pick one and execute it manually once.
Development
npm run build # validate and produce lib/index.js
npm run build:client # validate and produce lib/client.js
dsh plugin --profile web add /path/to/dsh-web-network-optimizer # install from a local directory (development)
License
MIT
Links
More in this category
yjh051108/dsh-routing-suite★ 7005
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3675
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
hust-open-atom-club/oh-dsh★ 322
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
weijiafu14/pi2dsh★ 212
Pi Host ABI compatibility engine: after one install, unmodified Pi extensions from npm mount as native DSH plugins with `dsh plugin add <pi-package>`. Verified end to end on stock DSH with pi-mcp-adapter (full MCP manager: OAuth, resources, prompts, MCP Apps, elicitation, sampling), @tintinweb/pi-subagents, pi-code, pi-hermes-memory and pi-background-tasks; `pi2dsh inspect` reports a package's compatibility before installing.
Fishquito7/dsh-skill-mcp-panel★ 179
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
lire1131/dsh-undo-savepoint★ 176
Undo/redo & rollback system for DSH: every config change is auto-snapshotted; undo/redo/restore to any version from the WebUI or the offline CLI/GUI tools (works even when DSH fails to boot).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.