Documentation
Learn how to integrate ServeProxy and optimize your website images in minutes.
How It Works
ServeProxy is a high-performance image CDN built with Rust. When you request an image through our service, we automatically optimize and cache it for lightning-fast delivery worldwide.
The Process
- → Request: You send an image URL to ServeProxy
- → Fetch: We download the image from your origin server (first time only)
- → Optimize: Images are converted to modern formats like AVIF or WebP
- → Cache: The optimized image is stored in our multi-tier cache
- → Deliver: Served from the nearest location via Cloudflare's global network
Caching Duration
| Cache Location | Duration |
|---|---|
| ServeProxy Servers | 7 days |
| Cloudflare Edge Network | 14 days |
| User Browser | 7 days (via Cache-Control headers) |
Image Optimization
ServeProxy automatically optimizes your images based on their format. We use modern compression techniques to reduce file sizes by 50–75% while maintaining visual quality.
Format Handling
| Original Format | Output | Result |
|---|---|---|
| JPEG, PNG, BMP | AVIF | 50–75% smaller, same quality |
| Static WebP | AVIF | Further optimized compression |
| Animated GIF | Animated WebP | Preserves animation, smaller file |
| Static GIF | AVIF | Standard optimization |
| Animated WebP | WebP (unchanged) | Already optimized |
| SVG | SVG (sanitized) | Security cleaned, cached |
Quality Settings
We use carefully tuned quality settings that balance file size and visual clarity. Most users can't tell the difference between the original and optimized version.
- → AVIF Compression: Quality level 75 provides excellent results for photos and graphics
- → WebP Animation: Maintains original frame timing and loop behaviour
- → SVG Safety: Removes scripts and potentially harmful content while preserving design
Usage Limits
Rate Limiting
| Limit Type | Value |
|---|---|
| Uncached requests per IP | 5,000 every 10 minutes |
| Block duration if exceeded | 1 hour |
| Maximum image file size | 5 MB |
Security Features
- → HTTPS Only: All images are fetched via HTTPS for security
- → SVG Sanitization: Scripts and harmful content removed from SVG files
- → Domain Filtering: Certain restricted domains are blocked automatically
- → Timeout Protection: Image fetches timeout after 15 seconds
Integration Examples
HTML Image Tag
<img src="https://serveproxy.com/?url=https%3A%2F%2Fexample.com%2Fimage.jpg"
alt="Description"
loading="lazy">
JavaScript Dynamic Loading
function loadOptimizedImage(originalUrl) {
const encodedUrl = encodeURIComponent(originalUrl);
return `https://serveproxy.com/?url=${encodedUrl}`;
}
const img = new Image();
img.src = loadOptimizedImage('https://example.com/image.jpg');
document.body.appendChild(img);
CSS Background Image
.hero {
background-image: url('https://serveproxy.com/?url=https%3A%2F%2Fexample.com%2Fhero.jpg');
background-size: cover;
background-position: center;
}
React Component
function OptimizedImage({ src, alt, ...props }) {
const optimizedSrc = `https://serveproxy.com/?url=${encodeURIComponent(src)}`;
return (
<img
src={optimizedSrc}
alt={alt}
loading="lazy"
{...props}
/>
);
}
WordPress Integration
Free WordPress plugin
Install our plugin and all image URLs are automatically rewritten. No code changes required.
Checking If It Works
Response Headers
Open your browser's developer tools (F12) and check the Network tab. Look for these headers on your images:
X-Serveproxy-Cache-Status: HIT
X-Serveproxy-Image-Hash: abc123...
X-Serveproxy-Node: server-name
- → Cache-Status HIT: Image is being served from our cache
- → Content-Type: Shows the optimized format (usually image/avif or image/webp)
- → Cache-Control: Tells browsers to cache the image for 7 days
Common Issues
| Problem | Solution |
|---|---|
| Image not loading | Check that the original URL is accessible and under 5 MB |
| 429 error (rate limit) | Wait 10 minutes or reduce request frequency |
| 400 error | Verify the URL is properly encoded and valid |
| Slow first load | Normal — the first request fetches and processes the image |
https://serveproxy.com/stats to see service-wide statistics including total requests served in the past 7 days.