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

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
V
Visual Studio Blog
有赞技术团队
有赞技术团队
U
Unit 42
D
Docker
小众软件
小众软件
F
Full Disclosure
I
Intezer
Scott Helme
Scott Helme
P
Privacy International News Feed
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
B
Blog
Martin Fowler
Martin Fowler
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
宝玉的分享
宝玉的分享
S
Security Affairs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
C
Cisco Blogs
云风的 BLOG
云风的 BLOG
Schneier on Security
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Threat Research - Cisco Blogs
量子位
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Heimdal Security Blog
N
Netflix TechBlog - Medium
H
Hacker News: Front Page
P
Proofpoint News Feed
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
S
Schneier on Security

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 See your available credits at a glance Astro 6 just works on Netlify Limit AI feature usage OpenAI GPT-5.4 and GPT-5.4 Pro in AI Gateway & Agent Runners Deploy Preview screenshots in agent runs Gemini 3.1 Flash-Lite Preview now available in AI Gateway GPT-5.3 Instant now available in AI Gateway Use Netlify Agent Runners from Linear Automatic PHP bot scan blocking now live on all plans Support for stale-while-revalidate in Cache API Gemini 3.1 Flash Image Preview now available in AI Gateway GPT-5.3-Codex now available in AI Gateway Gemini 3.1 Pro Preview now available in AI Gateway Claude Sonnet 4.6 now available in AI Gateway and Agent Runners Sync changes with Agent Runners without Git Claude Opus 4.6 now available in AI Gateway and Agent Runners Agent Runners improvements recap 6 new React Router & Remix CVEs: what you need to know Vulnerability in Node.js: what Netlify users need to know 5 SvelteKit security vulnerabilities: what Netlify users need to know GPT-5.2-Codex Now Available in AI Gateway and Agent Runners Play Games While Agent Runners Do the Work Prerender.io support updated as new extension Gemini 3 Flash Preview now available in AI Gateway GPT-image-1.5 now available in AI Gateway AI Gateway now Generally Available Observability release is here Prerender extension now generally available Action required: React/Next.js CVE-2025-55184 and CVE-2025-55183 GPT-5.2 and GPT-5.2-Pro now available in AI Gateway and Agent Runners GPT-5.1-Codex-Max now available in AI Gateway and Agent Runners Netlify’s response to the critical React security vulnerability Netlify Vite Plugin now supports AI Gateway locally Claude Opus 4.5 now available in AI Gateway Projects deployed using a zip file via API now support branch deploys Day one support for Angular v21 on Netlify Gemini 3 now available in AI Gateway and Agent Runners DNS record management simplified for teams in Netlify organizations Skew protection for CLI workflows Support for more domain TLDs GPT-5.1 model now available in AI Gateway React Router 7 apps can now be deployed to Edge Functions | Netlify Changelog Git SHA exposed for triggered deploys | Netlify Changelog Test scheduled functions in Netlify dashboard | Netlify Changelog Revert agent run in a task | Netlify Changelog Deletion improvements with Netlify Blobs | Netlify Changelog Preview Server restart for cross-functional collaborators | Netlify Changelog AI inference usage graphs | Netlify Changelog Buy credit packs on demand | Netlify Changelog React Router 7 middleware now supported | Netlify Changelog Skew protection now available | Netlify Changelog Next.js 16 is ready to deploy on Netlify | Netlify Changelog Enforce Git-based workflows for production deploys | Netlify Changelog Claude Haiku 4.5 is now available in the AI Gateway | Netlify Changelog GPT 5 Pro now available in the AI Gateway | Netlify Changelog Updates to credit-based Personal and Pro plans | Netlify Changelog New AI workflows: Agent Runners and AI Gateway (beta) | Netlify Changelog Netlify pricing update: Introducing credit-based plans | Netlify Changelog Security Update: Multiple vulnerabilities in Next.js | Netlify Changelog ChatGPT deep link for failed deploy analysis | Netlify Changelog Equinix IP address expiring for 4-year old sites | Netlify Changelog Nuxt 4 support + new @netlify/nuxt module for local dev | Netlify Changelog Smart Secret Scanning for AI-Generated Code | Netlify Netlify DB: Serverless PostgreSQL Database | Netlify One-click install Netlify MCP on Cursor | Netlify Changelog Netlify MCP Server: AI Agents Can Now Deploy Code Directly | Netlify Netlify Becomes Official Vite Deployment Partner + New Plugin | Netlify Angular 20 support | Netlify Changelog Netlify CLI 21.4.1 UI and workflow enhancements | Netlify Changelog Security Update: Next.js sites on Netlify not vulnerable to CVE-2025-32421 | Netlify Changelog
Introducing the Netlify Cache API
Nahrin Jalal · 2025-05-08 · via Netlify Changelog

Netlify’s global caching infrastructure has been helping millions of developers build web applications with best-in-class performance and maximum flexibility. It has democratized features like cache tags, introduced full control over cache keys for optimal hit ratios and pioneered a globally-persisted caching layer that works with any framework (or without one). Always with a relentless focus on leveraging web standards and reducing vendor-specific API surfaces.

Today, we’re adding another item to that toolbox by launching a beta version of the Netlify Cache API.

Why another caching primitive?

When building applications with Netlify Functions or Netlify Edge Functions, developers can leverage the full power of our caching layer by returning a response with caching headers. This ensures that functions don’t even run for requests that can be served from the cache, offering a more performant experience to users and a more cost-efficient operation.

When functions do have to run, they often make HTTP requests to third-party services or APIs. These HTTP calls introduce additional points of failure, since the remote resources can be slow or unavailable, suffer from rate-limiting or quota enforcement, and generate significant costs.

These are the classic problems that are solved with caching. But how do you cache these individual network calls triggered by your functions when you can’t serve the entire response from the cache? This is now possible with the Netlify Cache API.

Built on web standards

Unlike the existing caching primitives that live in the CDN and which end clients (like your browser) interact with, the Netlify Cache API was built to be accessed programmatically from a JavaScript or TypeScript application.

The example below shows how you could write a function that accepts a URL and gets the corresponding response, either from the cache (if available) or from the network. When fetching from the network, it stores the result in the cache so it can be leveraged in subsequent invocations.

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

async function getFromCacheOrFetch(url: string) {

const cached = await cache.match(url)

if (cached) {

return cached

}

const res = await fetch(url)

if (res.ok) {

await cache.put(url, res.clone())

}

return res

}

If you’re squinting your eyes looking for the Netlify-specific APIs, let me tell you that there are none. The entire feature is built on top of the web standard Cache and CacheStorage APIs and it’s a perfect companion to the Fetch API.

By building our primitives on web standards, we make them predictable and easy to reason about. This means that if you learn the web platform, you’ll instinctively know how to use our platform.

To control how long a response will be cached for and how cache keys are generated from requests, you can use the same HTTP configuration options supported by our caching infrastructure, including on-demand revalidation.

Batteries included

We’ve also created a new @netlify/cache package that gives you full control over the entire Netlify caching layer with maximum convenience.

This includes a fetchWithCache function that lets you fetch a resource from the cache with the network as a fallback, persisting the response in the cache for future invocations with the option to configure the exact caching behavior.

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

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

ttl: 12 * HOUR,

tags: ["product", "sale"]

})

We want to give developers the best of both worlds: the core API built on web standards lets you use the platform rather than getting locked in to a specific vendor, and the @netlify/cache package unlocks the DX and AX that Netlify is known and loved for.

Works with your favorite framework

It works just fine without one, but the Cache API has been designed to support any web framework — like TanStack Start. The example below shows how you could use it to cache API calls in the Basic Start template by changing a few lines of code.

import { fetchWithCache } from '@netlify/cache' // [!code ++]

import { json } from '@tanstack/react-start'

import { createAPIFileRoute } from '@tanstack/react-start/api'

import type { User } from '../../utils/users'

export const APIRoute = createAPIFileRoute('/api/users')({

GET: async ({ request }) => {

console.info('Fetching users... @', request.url)

const res = await fetch('https://jsonplaceholder.typicode.com/users') // [!code --]

const res = await fetchWithCache('https://jsonplaceholder.typicode.com/users') // [!code ++]

if (!res.ok) {

throw new Error('Failed to fetch users')

}

const data = (await res.json()) as Array<User>

const list = data.slice(0, 10)

return json(list.map((u) => ({ id: u.id, name: u.name, email: u.email })))

},

})

Optionally, you could pass a cache settings object to configure how long to cache the response, set any cache tags, etc.

The Cache API documentation page has a dedicated section with information about using the Cache API with your framework.

Demo time

To get a sense of the impact that the Cache API may have on your application, head over to our demo site. (Dress code: space suit.)

It’s also a good example of how easy it is to use the feature with a framework — in this case, Astro.

Progress indicator from Cache API demo site

Available in beta today

The Netlify Cache API available as a beta feature on all plans starting today. Refer to the documentation for the full API reference and more details about the primitive.