惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园_首页
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
月光博客
月光博客
小众软件
小众软件
S
SegmentFault 最新的问题
量子位
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Netlify Changelog

Gemini 3.5 Flash now available in Agent Runners 4 Nuxt CVEs: what Netlify users need to know Gemini 3.5 Flash now available in AI Gateway Agent Runners workflow improvements Next.js & React security release (May 2026): what to know Block project transfers out of your team Gemini 3.1 Flash-Lite now available in AI Gateway OpenAI GPT-5.5 Instant now available in AI Gateway New `netlify logs` CLI command Deploy to Netlify with Stripe Projects Netlify Database is now generally available OpenAI GPT-5.5 and GPT-5.5 Pro in AI Gateway & Agent Runners Rename an agent run GPT Image 2 now available in AI Gateway New frontend-design skill for Agent Runners Claude Opus 4.7 now available in AI Gateway and Agent Runners Pricing updates for Credit-based plans New sorting and filter controls on the Members page Netlify Database GA coming soon, no new databases for now Deploy logs streaming is now faster Netlify CLI adds prompt-based creation and anonymous deploys Deploy from Codex with the Netlify Plugin Hydrogen with React Router 7 now supported on Netlify Monitor credit usage by day Invoices for Enterprise Available on the Billing Page AI app development on production infrastructure with Netlify Introducing Prompt Templates OpenAI GPT-5.4 Nano and GPT-5.4 Mini in AI Gateway Change your pricing plan Internal Builder Role & Project Access Controls
Support for stale-while-revalidate in Cache API
2026-02-27 · via Netlify Changelog

The Netlify Cache API now has full support for stale-while-revalidate (SWR). This was a previous limitation of the Cache API that has now been lifted, thanks to a request from a customer.

When using fetchWithCache with the swr option, background revalidation is handled automatically. If a response is stale but still within the SWR window, it’s served immediately while a fresh response is fetched and cached in the background.

import { fetchWithCache, DAY, HOUR } from "@netlify/cache";

import type { Config, Context } from "@netlify/functions";

export default async (req: Request, context: Context) => {

const response = await fetchWithCache("https://example.com/expensive-api", {

ttl: 2 * DAY,

swr: HOUR,

tags: ["product"],

});

return response;

};

export const config: Config = {

path: "/api/products",

};

For users who interact directly with cache.match and cache.put, a new needsRevalidation method lets you check whether a cached response is stale and trigger background revalidation manually:

import { needsRevalidation, cacheHeaders, MINUTE, HOUR } from "@netlify/cache";

import type { Config, Context } from "@netlify/functions";

const cache = await caches.open("my-cache");

export default async (req: Request, context: Context) => {

const request = new Request("https://example.com/expensive-api");

const cached = await cache.match(request);

if (cached) {

if (needsRevalidation(cached)) {

context.waitUntil(

fetch(request).then((fresh) => {

const response = new Response(fresh.body, {

headers: {

...Object.fromEntries(fresh.headers),

...cacheHeaders({ ttl: MINUTE, swr: HOUR }),

},

});

return cache.put(request, response);

})

);

}

return cached;

}

const fresh = await fetch(request);

const response = new Response(fresh.body, {

headers: {

...Object.fromEntries(fresh.headers),

...cacheHeaders({ ttl: MINUTE, swr: HOUR }),

},

});

context.waitUntil(cache.put(request, response.clone()));

return response;

};

export const config: Config = {

path: "/api/data",

};

Learn more in the Cache API documentation and the caching overview.