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

推荐订阅源

WordPress大学
WordPress大学
GbyAI
GbyAI
P
Proofpoint News Feed
B
Blog
MyScale Blog
MyScale Blog
V
V2EX
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
量子位
Jina AI
Jina AI
博客园 - 叶小钗
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
罗磊的独立博客
L
LangChain Blog
I
InfoQ
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
小众软件
小众软件
V
Visual Studio Blog
月光博客
月光博客
The Cloudflare Blog
雷峰网
雷峰网

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.