Skip to content

Performance: cached remote files, debounced storage, 429 backoff - #577

Open
GuilhermeSenaRJ wants to merge 1 commit into
dimdenGD:mainfrom
GuilhermeSenaRJ:perf-cache-debounce-backoff
Open

GuilhermeSenaRJ wants to merge 1 commit into
dimdenGD:mainfrom
GuilhermeSenaRJ:perf-cache-debounce-backoff

Conversation

@GuilhermeSenaRJ

Copy link
Copy Markdown

Small performance improvements. Not tested on Firefox, only reviewed for syntax; tested paths are Chrome.

  • Startup: remote files (bundle/vendor/css/...) are served from the Cache API or local copy instantly. They are revalidated in the background ~15s after load using ETag, and applied on next load. Previously ~7 MB was downloaded from GitHub on every open. OTDalwaysUseLocalFiles is still respected. Extra oldtd.org scripts are fetched in parallel.
  • destroyer.js: setInterval had no delay (ran every few ms for 5s); now 50 ms.
  • localStorage: feeds/columns/settings/followsData/verifiedUser writes are debounced (400 ms) and flushed on pagehide/hidden/beforeunload.
  • Refresh: interval is 4x slower in background tabs and doubles (max 8x, resets after 5 min) after a 429. Optional window.__OTD_OPTS / chrome.storage.local.otd_opts can set refreshInterval, slowInBackground, remoteUpdates.
  • Fixed injectAccount interval never being cleared; in-flight dedupe for getFollows.

Happy to split this into separate PRs if you prefer.

🤖 Generated with Claude Code

…ckoff

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant