Skip to content

Claude/add claude documentation u0 oma#4

Closed
chanphiromsok wants to merge 2 commits into
mainfrom
claude/add-claude-documentation-u0Oma
Closed

Claude/add claude documentation u0 oma#4
chanphiromsok wants to merge 2 commits into
mainfrom
claude/add-claude-documentation-u0Oma

Conversation

@chanphiromsok
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits March 24, 2026 04:48
- New `cacheTTLDays` param in `startServer()` (default: 2 days) — files
  older than the TTL are evicted on server start, fitting daily-feed use
  cases where yesterday's segments are always stale.

- New `debugLogging` param in `startServer()` — enables `[HLSCache]`
  prefixed log lines (HIT/MISS/SAVED/FAIL, manifest rewrites, prune
  stats, connection count). Gated by `#if DEBUG` in CacheLogger.swift so
  the flag is a no-op in release builds with zero runtime overhead.

- `VideoCacheStorage.prune()` now runs three passes in order:
    1. TTL — delete files older than `cacheTTLDays`
    2. Disk guard — evict oldest files when free disk < 500 MB
    3. LRU — trim to `maxCacheSize` as before

- New `ios/CacheLogger.swift` — lightweight singleton logger that
  compiles out entirely in release builds.

- Android stub updated to match the new `startServer` signature (no-op).

Note: run `yarn nitrogen` to regenerate the Nitro bridge boilerplate
after this interface change.

https://claude.ai/code/session_016aKiYNJycuCWkNYogZNqsY
…GUIDE

New API surface (all platforms — Android stubs return resolved no-ops):

- stopServer()       — gracefully stop the proxy and all active connections
- isRunning          — synchronous boolean property (Nitro getter)
- invalidateUrl(url) — remove cached file for a single remote URL
- getCacheStats()    — returns { fileCount, totalSizeBytes, freeDiskSpaceBytes }

Implementation details:
- VideoCacheStorage.getStats() reads the cache directory once and sums
  file sizes without holding any locks — lightweight enough to call on demand
- VideoProxyServer.storage promoted from private to internal so HybridHlsCache
  can access it directly for invalidateUrl / getCacheStats without an extra
  indirection layer
- CacheStats is defined as a plain Nitro interface (generates a C++ struct
  after yarn nitrogen); Android stub constructs it with zero values

Also adds FLOW_GUIDE.md — a full technical reference covering:
  request lifecycle (hit / miss / manifest paths), eviction flow (TTL →
  disk guard → LRU), design pattern map, API reference, and debug log table.

Note: run yarn nitrogen to regenerate the Nitro bridge after the interface
changes in src/HlsCache.nitro.ts.

https://claude.ai/code/session_016aKiYNJycuCWkNYogZNqsY
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.

2 participants