Functions resources
Refer to the following resources to learn more about Netlify Functions:
Or start building with one of our platform starters.
Netlify Platform Primitives are framework-agnostic runtime features of our platform. They are used in our framework adapters to offer consistent functionality and freedom regardless of your chosen framework.
These primitives can also be used directly to transform stale pages and static pages into dynamic experiences that best suit your architectural strategy and needs:
With Netlify Functions, your serverless functions are version-controlled, built, and deployed along with the rest of your Netlify site, and we will automatically handle service discovery through our built-in API gateway. This eliminates overhead and brings the power of Deploy Previews and rollbacks to your functions. During a build, we automatically generate functions for web frameworks that support server-side rendering and/or API endpoints. This is done though a build plugin or adapter for that framework.
If you are using a framework that does not support server-side rendering, you can still add dynamic behavior by creating functions directly.
Functions resources
Refer to the following resources to learn more about Netlify Functions:
Or start building with one of our platform starters.
Edge Functions connect the Netlify platform and workflow with an open runtime standard at the network edge. This enables you to build fast, personalized web experiences with an ecosystem of development tools.
Using TypeScript and JavaScript, you can modify network requests to localize content, serve relevant ads, authenticate users, personalize content, redirect visitors, and much more. Edge Functions also support a new generation of edge-first web frameworks allowing your entire app to run at the edge, dramatically increasing performance in many cases.
All this dynamic processing happens in a secure runtime based on Deno directly from the worldwide network edge location closest to each user for fast response times. Plus, you have the option to cache edge function responses for even faster response times. With Netlify, your edge functions are version-controlled, built, and deployed along with the rest of your Netlify site. This eliminates overhead and brings the power of Deploy Previews and rollbacks to your edge functions.
Edge Functions resources
Refer to the following resources to learn more about Netlify Edge Functions:
Or start building with one of our platform starters.
Netlify’s Background Functions provide an option for serverless functions that run for up to 15 minutes and don’t need to complete before a visitor can take next steps on your site. For tasks like batch processing, scraping, and slower API workflow execution, they may be a better fit than synchronous functions.
Learn more about Background Functions
Scheduled Functions is a feature of Netlify Functions that enables you to run functions on a regular and consistent schedule, much like a cron job. Scheduled functions can do almost anything that serverless functions do today, though some tasks are better suited to scheduled functions than others.
For example, you may want to:
Learn more about Scheduled Functions
With Netlify Image CDN, you can transform images on demand without impacting build times. Netlify Image CDN also handles content negotiation to use the most efficient image format for the requesting client. Optimizing the size and format of your images improves both the runtime performance and reliability of your site. Transformations are integrated natively into the CDN so that repeated requests leverage layers of caching for improved performance. Many frameworks on Netlify use Netlify Image CDN to power image optimization and transformation.
Image CDN resources
Refer to the following resources to learn more about Netlify Image CDN:
Or start building with one of our platform starters.
With Netlify Blobs, you can store and retrieve blobs and unstructured data. You can also use this feature as a simple key/value store or basic database.
Netlify Blobs is a highly-available data store optimized for frequent reads and infrequent writes.
For maximum flexibility, it offers a configurable consistency model. If multiple write calls to the same key are issued, the last write wins.
We automatically handle provisioning, configuration, and access control for you. This integrated zero-configuration solution helps you focus on building business value in your project rather than toil on setting up and scaling a separate blob storage solution.
Blobs resources
Refer to the following resources to learn more about Netlify Blobs:
Or start building with one of our platform starters.
Netlify’s global caching infrastructure is built to provide stellar performance without any stale pages or broken assets for your visitors.
Static asset responses on Netlify are cached on Netlify’s global edge nodes and automatically invalidated whenever a deploy changes the content.
However, responses coming from Netlify Functions, Edge Functions, and proxies are not cached by default, because these responses are dynamic and their content may change per request.
To cache these dynamic responses, we offer fine-grained cache controls via response headers. These controls go from basic, common capabilities (such as setting a maximum age for content) to state-of-the art patterns such as on-demand invalidation. All caching features follow web standards as much as possible.
Additionally, you can use the Cache API to programatically store the responses from network calls made within your function or edge function code.
Here are a few key caching features:
Stale while revalidate is a caching pattern, set via response headers, that allows the cache to keep serving a stale object out of the cache while the object is revalidated in the background. This can be impactful for implementing API caching or patterns like incremental static regeneration (ISR).
Learn more about the stale while revalidate directive
If you want to invalidate cached objects while their cache control headers indicate they’re still fresh, you can purge the cache by site or cache tag. These granular options for refreshing your cache without redeploying your entire site optimize developer productivity for your team and site performance for your customers. On-demand invalidation across the entire network takes just a few seconds, even if you’re purging a tag associated with thousands of cached objects.
Learn more about on-demand cache invalidation
By default, when a site visitor makes a request to Netlify for content that is generated by a function, the specific edge node the visitor has connected to will only check its own local cache. If fresh content is not found in that node’s cache, the node invokes the function to generate a new response.
To reduce function invocations and latency, you can use the durable
directive for a function’s response. This stores the response in a shared cache mechanism. Whenever that content is requested, edge nodes that don’t have the response locally check the durable cache first, and only invoke a function if necessary.
Learn more about the durable cache
When running some frameworks on Netlify, caching features are automatically put to use by the framework adapter to serve framework capabilities.
For example, Netlify's OpenNext adapter fully supports on-demand revalidation in Next.js by using the caching primitives offered by Netlify.
With most other frameworks, or for sites without a framework, developers have more direct control of and responsibility for caching behavior. Netlify provides an extensive set of guides for these cases in our Developers Hub, as well as helpful utility functions.
Caching resources
Here are a few of our framework-specific guides:
Set up a Preview Server to share a customizable preview environment where you and key collaborators can preview content updates alongside code updates in real-time.
Preview Servers run in secure, isolated virtual containers in Netlify’s infrastructure by taking advantage of the same netlify dev command that you run locally, but in a cloud environment with:
Framework auto-detection: Preview Servers automatically detect your site’s framework (Gatsby, Next.js, Astro, etc.) and configure the appropriate settings Development server mode: Uses the development mode of your framework, allowing for instant page regeneration Webhook integration: Connects to your CMS via webhooks to trigger content refreshes Resource monitoring: Tracks CPU, memory, and disk usage in near real-time Secure access: Uses existing access controls, so team members with appropriate roles can access without anything new to configure
For developers, this means you can set up Preview Servers once and provide a self-service model, freeing you to focus on core development instead of facilitating previews or struggling through a slow review process.
Learn more about Preview Servers
Your feedback helps us improve our docs.