static assets
Files served exactly as they are, such as images, fonts, CSS and compiled JavaScript.
In more detail
Because they do not change per request, static assets can be cached for a long time by browsers and CDNs, often with a content hash in the file name. They should be served directly without running application code.
Example
Next.js serves them from public/ and .next/static; middleware matchers usually exclude them.Related terms
- public folder — The project folder whose files are served as is from the site root, such as public/logo.png at /logo.png.
- .next directory — The folder where next build writes its output: compiled server code, static assets in .next/static and, if enabled, .next/standalone.
- matcher (middleware) — The config.matcher option exported from middleware.ts that lists which paths the middleware runs on.
Taught in
- Edge Middleware: Auth Verification & Route Matchers — Next.js 15 & Modern App Router Architecture
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture
- Containerized Deployment: Multi-Stage Docker Builds — Next.js 15 & Modern App Router Architecture