To set up image optimization on Epycbyte using Next.js, follow these steps:
-
Import the Image Component: Use
import Image from 'next/image';to access Epycbyte's optimization features. -
Use the Image Component: In your React components, wrap the image source with the
Imagecomponent. Thesrcprop can be a local file path or a URL. -
Let Epycbyte Handle Optimization: Epycbyte automatically optimizes images for different devices and generates optimized URLs with parameters like width (
w) and quality (q). -
Cache Management:
- For local images, cache expires after 31 days on the Edge Network.
- For remote images, cache TTL is determined by the upstream server's Cache-Control header or a minimum of 60 seconds.
-
Invalidate Cache (Remote Images): To manually invalidate, append a query parameter like
?v=2to thesrc.