Promote to production: same-origin HF model proxy - #91
Merged
Conversation
The Whisper model re-downloaded on every refresh: transformers.js fetches weights from huggingface.co, which 302-redirects large files to a CDN, and neither the browser nor Workbox reliably caches redirected cross-origin responses. Add a /hf/* proxy to the edge Worker that resolves the redirect server-side and returns the bytes same-origin with 'cache-control: immutable' (+ Cloudflare edge cache). Point transformers.js env.remoteHost at it (skipped on localhost dev). The browser HTTP-caches the same-origin immutable response — the same mechanism that already makes the self-hosted OCR model cache reliably — so it survives refreshes. Falls back to the default host if env can't be set. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(voice-to-text): proxy HF model weights same-origin so they cache
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
goodwebtools | f99c542 | Aug 01 2026, 12:22 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proxies HF model weights same-origin with immutable caching so the Whisper model stops re-downloading on refresh.
🤖 Generated with Claude Code