250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- REACT
- useState
- express.js
- solidity
- Props
- web
- bitcoin
- CSS
- concept
- node.js
- JavaScript
- error
- HTML
- SSR
- Ethereum
- 기준
- built in object
- typeScript
- 삶
- Interface
- API
- Redux
- tailwindcss
- graphQL
- hardhat
- middleware
- blockchain
- evm
- CLASS
- nextJS
Archives
- Today
- Total
ReasonJun
Nextjs : Edge Functions 본문
728x90
What It Is:
- A lightweight, serverless runtime environment designed for executing code closer to users, at the edge of the network.
- Built on a subset of standard Web APIs, prioritizing speed, security, and compatibility.
- Integrated into Next.js, offering specific features:
- Edge API Routes
- Middleware
- Server components (experimental)
Key Characteristics:
- Minimal: Supports a smaller set of APIs compared to the full Node.js runtime.
- Fast: Executes code quickly due to its lightweight nature and edge deployment.
- Secure: Designed with security in mind, mitigating risks associated with traditional server-side rendering.
- Interoperable: Aligns with Web standards for compatibility across environments.
When to Use It:
- Low-latency dynamic content: Ideal for delivering personalized content or data with minimal delays.
- Simple server-side logic: Well-suited for tasks like authentication, authorization, or simple data fetching.
- Global distribution: Optimizes performance and scalability for users worldwide.
Key Features in Next.js:
- Edge API Routes: Create API routes that run on the Edge Runtime for fast responses and global distribution.
- Middleware: Intercept requests and responses for tasks like authentication or redirects.
- Server Components (experimental): Server-side components that can fetch data and render on the Edge Runtime.
Limitations:
- Limited API support: Doesn't support all Node.js APIs or globals like require.
- Code size restrictions: Deployment platforms often have code size limits for Edge functions.
Best Practices:
- Use it for small, fast functions that don't require extensive Node.js APIs.
- Prioritize Web APIs and ES modules for compatibility.
- Test thoroughly to ensure code functions as expected in the Edge Runtime environment.
https://vercel.com/docs/functions/edge-functions
Edge Functions Overview
Vercel's Edge Functions enable you to deliver dynamic, personalized content with the lightweight Edge Runtime. Learn more about Edge Functions here.
vercel.com
728x90