This will optimize external and local images using sharp
Drop the +server.ts in routes/api/image
+server.ts
routes/api/image
Drop the Image component wherever you wish
Add sharp to your project
Cached images are stored in .cache/images.
.cache/images