Appearance
Frontend Caching Strategy
日期:2026-06-17 · 场景:Frontend Caching Strategy
📖 Vocabulary
| Word | Meaning | Example |
|---|---|---|
| polyfill | 垫片(补齐旧环境的新 API) | Import the polyfill for browsers that lack fetch support. 为不支持 fetch 的浏览器引入垫片。 |
| bundling | 打包(合并模块为可部署文件) | Tree shaking reduced the bundling size by half. 摇树优化让打包体积减半。 |
| snapshot | 快照(某时刻的完整状态拷贝) | The snapshot lets us roll back the database instantly. 快照让我们能瞬间回滚数据库。 |
| eviction | 淘汰(缓存满时移除旧项) | Use LRU eviction to keep the cache size bounded. 用 LRU 淘汰策略保持缓存大小有界。 |
| encrypt | 加密(转为密文保护内容) | Always encrypt credentials at rest and in transit. 凭证在静态存储和传输时都要加密。 |
🎧 Audio
💬 Dialogue
A: The bundle size grew again after the upgrade. A:升级后打包体积又变大了。
B: We need better bundling and code splitting. B:我们需要更好的打包和代码分割。
A: Also add a polyfill only for the legacy chunk. A:另外只给旧代码块加垫片。
B: Right. And set a clear eviction policy on the cache. B:对。还要给缓存定个明确的淘汰策略。
A: Should we encrypt the cached user snapshot? A:要不要加密缓存的用户快照?
B: Yes, especially the tokens stored in local storage. B:要,尤其是存在 local storage 里的令牌。