编程技术

Next.js 数据缓存失效(revalidateTag-revalidatePath)实战

引言 - 在 App Router 下,Next.js 的 Data Cache 提供页面与组件级的缓存;使用 `revalidateTag`/`revalidatePath` 可在服务端动作或接口路由中精准触发失效与刷新。 能力与用法(已验证) - revalidateTag:为数据请求设置 tag 并在变更后调用失效该 tag 下的所有缓存,适合跨页面共享数据刷新。来源:Next.js

OpenFeature 特征开关跨语言实践(2025)

# OpenFeature 特征开关跨语言实践(2025) OpenFeature 为特征开关提供跨语言标准化评估与上下文模型。 ## 一、集成与上下文 - SDK 集成:在各语言中统一评估接口与上下文传递。 - 上下文:用户/租户/设备等属性驱动评估结果。 ## 二、Provider 与治理 - Provider:对接后端平台(如 LaunchDarkly/Flagd)。 - 审计:记录变

Navigation API:无刷新导航拦截与视图更新

--- title: Navigation API:无刷新导航拦截与视图更新 keywords: - Navigation API - navigation.onnavigate - SPA/MPA - 视图更新 - 路由拦截 description: 介绍 Navigation API 的事件与拦截机制,在 MPA 中实现无刷新导航与视图更新,提升可访问性与性能,替代历史的 popstate/h...

Network Information API:带宽类型与自适应加载

--- title: Network Information API:带宽类型与自适应加载 keywords: - Network Information - effectiveType - downlink - rtt - saveData description: 说明网络信息的读取与变更事件,根据带宽类型与用户省流偏好调整资源加载策略,并给出示例与验证。 categories: - 应用...

Notification API:权限、动作与交互治理

--- title: Notification API:权限、动作与交互治理 keywords: - Notification - requestPermission - showNotification - actions - notificationclick description: 介绍通知权限与展示、动作按钮与点击交互,前后台协作与合规治理,包含页面与 Service Worker 示例...

OpenResty与Nginx Lua:网关扩展与策略控制

--- title: OpenResty与Nginx Lua:网关扩展与策略控制 keywords: - OpenResty - Nginx - Lua - 网关策略 - 流量治理 description: 通过 OpenResty 在 Nginx 层以 Lua 扩展网关能力,实现鉴权、路由与限流等策略控制。 categories: - 文章资讯 - 技术教程 --- # OpenRest...

Page Visibility API:visibilitychange 与后台策略

--- title: "Page Visibility API:visibilitychange 与后台策略" keywords: - Page Visibility - document.hidden - visibilitychange - 后台策略 - 节能 description: "介绍页面可见性状态与事件,用于暂停动画与轮询、降低后台开销,结合生命周期与用户体验策略...

Paint Timing API:FCP 的采集与优化路径

--- title: "Paint Timing API:FCP 的采集与优化路径" keywords: - FCP - PerformancePaintTiming - first-contentful-paint - PerformanceObserver - 采集与优化 description: "说明 Paint Timing 的 `first-contentful-p...

Pointer Lock API:鼠标捕获与安全约束

--- title: "Pointer Lock API:鼠标捕获与安全约束" keywords: - Pointer Lock - requestPointerLock - movementX - movementY - 游戏与3D description: "说明 Pointer Lock 的鼠标捕获与相对移动事件,用于游戏与 3D 场景的视角控制,强调权限、手势与退出策略...