Image Optimization¶
Automatic image processing with intelligent caching
FastEdgy automatically optimizes images on-the-fly with intelligent caching. Transform, resize, and convert your images directly through URL parameters without any additional setup.
Key Features¶
- Automatic resizing: Resize images by width, height, or both
- Smart caching: Generated images are cached to avoid reprocessing
- Format conversion: Convert between JPEG, PNG, and WebP formats
- Responsive images: Perfect for modern web applications
- No upscaling: Never enlarges images beyond their original size
- Memory efficient: Optimized processing with quality control
Common Use Cases¶
- User avatars: Square thumbnails with consistent sizing
- Responsive images: Different sizes for mobile and desktop
- Product galleries: Uniform thumbnails for better layouts
- Performance optimization: WebP conversion for faster loading
- Modern formats: Automatic format selection for better compression
Basic Usage¶
Add URL parameters to any image download URL:
# Resize to 300px width (maintains aspect ratio)
GET /storage/download/photos/image.jpg?w=300
# Create 150x150 square thumbnail with cropping
GET /storage/download/photos/image.jpg?w=150&h=150&m=cover
# Convert to WebP format with resizing
GET /storage/download/photos/image.jpg?w=800&e=webp
URL Parameters¶
w
: Width in pixelsh
: Height in pixelsm
: Resize mode (contain
orcover
)e
: Output format (jpg
,png
,webp
)force_download
: Force file download instead of display
Resize Modes¶
Contain mode (default): Fits the image inside the specified dimensions without cropping. May leave empty space if aspect ratios don't match.
Cover mode: Fills the entire specified dimensions, cropping the image if necessary to maintain perfect fit.
Configuration¶
Set image quality in your environment file:
How It Works¶
- Request: Client requests image with optimization parameters
- Cache check: System checks if optimized version already exists
- Generation: If not cached, image is processed and saved
- Serving: Optimized image is served with proper content type
- Cleanup: Cache is automatically cleaned when source files are deleted
Performance Benefits¶
- Bandwidth savings: Smaller file sizes with WebP conversion
- Faster loading: Optimized images load quicker on all devices
- CDN friendly: Cached images work perfectly with CDNs
- Server efficient: Processing happens once, served many times
Ready to optimize your images? Check out practical examples: