Server Actions — a Next.js App Router feature (stable since Next 14, 2023): async functions on the server callable directly from React components (form or button). No need to write API routes. Marked with a "use server" directive. Progressive enhancement: work without JS via native form submission. Replaces the API-route + client-side fetch pattern for mutations.
Below: details, example, related terms, FAQ.
"use server" at the top of an async function<form action={submitAction}> — works without JS"use server";
export async function createPost(formData) {
const session = await auth();
if (!session) throw new Error('Unauthorized');
await db.post.create({ data: { title: formData.get('title') } });
revalidatePath('/posts');
}Page load speed directly impacts conversion, SEO rankings, and user satisfaction. Google uses Core Web Vitals as a ranking factor. Every extra second of load time cancost up to 7% in conversions.
Google Lighthouse-based analysis: Performance, Accessibility, Best Practices, SEO.
LCP (rendering), FID (interactivity), CLS (visual stability) — key Google metrics.
Breakdown by type: HTML, CSS, JavaScript, images, fonts. Size, request count, blocking resources.
Specific recommendations with savings estimates: image compression, caching, minification, etc.
Core Web Vitals for rankings
performance optimization
speed = conversions
performance regression
async/defer block rendering. Move to end or add attribute.Cache-Control, the browser reloads CSS/JS on every visit.loading="lazy" for images below the fold.brotli on;Cache-Control: max-age=31536000, immutable. HTML: max-age=0, s-maxage=60.<link rel="preload"> for fonts and CSS. Reduces LCP by 200-500ms.Speed check history, competitor comparison and PageSpeed monitoring.
Sign up freeServer Actions — short-lived, called from a component, type-safe, RPC-like. API routes — public endpoints for external clients.
You must re-validate auth + input inside the action. Next.js adds CSRF protection automatically. Always check ownership (IDOR).
Yes! If form action is a Server Action, submit works via native form POST without JS. Progressive enhancement.