Application Patterns
Frontend and Edge Delivery
Frontend systems need the same production discipline as backend services: ownership, release safety, observability, security, and rollback.
Delivery model
Define how the frontend is built, hosted, and invalidated.
- Static export, server rendering, or hybrid rendering.
- CDN, edge, or application runtime hosting.
- Asset versioning and cache invalidation.
- Environment-specific configuration.
- Preview deployments and production promotion.
- Rollback path for code and content.
Runtime patterns
- Static sites for documentation, marketing, and low-dynamic pages.
- Server-side rendering for personalized or frequently changing pages.
- Edge rendering for latency-sensitive lightweight logic.
- Backend-for-frontend APIs when clients need tailored aggregation.
- Feature flags for controlled rollout and fast disablement.
Observability
Frontend observability should include:
- Core web vitals and page load metrics.
- JavaScript errors and failed network requests.
- Release version, route, browser, and device context.
- Synthetic checks for critical flows.
- User-impacting incidents tied to backend traces where possible.
Security
- Enforce TLS and secure headers.
- Use content security policy where feasible.
- Keep secrets out of client bundles.
- Treat environment variables exposed to the browser as public.
- Protect admin and internal routes with real authorization.
- Scan dependencies and monitor vulnerable packages.
Watchouts
- CDN caching can hide broken rollouts and stale configuration.
- Client-side feature flags are not authorization controls.
- Preview deployments must not expose production data accidentally.
- Frontend errors often look like backend incidents to users.