The Philosophy of OptiFlow
OptiFlow Media is a technical demonstration of Smart Components: moving visual logic from the application bundle to the delivery layer.
The "Naive" Problem
Traditionally, handling diverse user-generated content in React requires complex manual logic. To prevent layout shifts (CLS), developers often use useEffectto fetch image metadata, determine orientation, and then apply conditional CSS.
Traditional Cost
+ 30 lines of client-side JS
+ Higher Cumulative Layout Shift (CLS)
+ Delayed Time to Interactive (TTI)
The Smart Solution
By leveraging Cloudinary Conditional Transformations, we offload this entire decision-making process to the CDN. Our component simply tells the server:"If this image is a portrait, generate a blurred background to fill the 16:9 frame."
Performance (Rick)
Zero layout shifts. The image arrives at the browser already formatted for its designated container.
Velocity (Dave)
Write one component that handles infinite edge cases without extra
if/else statements in your JSX.The Stack
- Next.js 16 (Turbopack)
- next-cloudinary
- Server Actions
- unified `use cache`
- Shadcn UI
- JSDoc/TypeDoc