Skip to content

πŸš€ Π’Ρ‹ΡΠΎΠΊΠΎΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ CDN для Битрикс с автоматичСской WebP ΠΊΠΎΠ½Π²Π΅Ρ€Ρ‚Π°Ρ†ΠΈΠ΅ΠΉ | High-performance CDN for Bitrix with automatic WebP conversion

License

Notifications You must be signed in to change notification settings

AAChibilyaev/bitrix-cdn

Repository files navigation

πŸš€ Bitrix CDN Server

Enterprise-grade CDN solution with automatic WebP/AVIF conversion for Bitrix CMS

Docker WebP AVIF Monitoring

⚑ Performance Boost

  • 70-93% smaller images with WebP/AVIF conversion
  • 3x faster page loads with smart content negotiation
  • 12 async workers processing 500+ images/minute
  • Real-time monitoring with Prometheus + Grafana

🎯 Smart Image Serving

# Intelligent content negotiation
AVIF (best) β†’ WebP (good) β†’ Original (fallback)
  • AVIF: 80% quality, maximum compression
  • WebP: 85% quality, wide browser support
  • Smart detection: Automatic format selection by browser
  • Caching: 1-year cache with immutable headers

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Bitrix CMS    │───▢│   SSHFS Mount   │───▢│  CDN Server     β”‚
β”‚   (Original)    β”‚    β”‚   (Remote)      β”‚    β”‚  (Optimized)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”‚
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚                    CDN Services                                β”‚
                       β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
                       β”‚  β”‚    Nginx     β”‚  β”‚  Converter  β”‚  β”‚    Monitoring       β”‚  β”‚
                       β”‚  β”‚  (Serving)   β”‚  β”‚ (WebP/AVIF) β”‚  β”‚ (Prometheus/Grafana)β”‚  β”‚
                       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

# 1. Clone repository
git clone https://github.com/AAChibilyaev/bitrix-cdn.git
cd bitrix-cdn

# 2. Start all services
docker compose up -d

# 3. Check status
./docker-manage.sh status

# 4. View monitoring
open http://localhost:3000  # Grafana

πŸ“Š Real-time Monitoring

Service URL Purpose
Grafana http://localhost:3000 Performance dashboards
Prometheus http://localhost:9090 Metrics collection
Health Check http://localhost:8088/health Service status

πŸ› οΈ Management Commands

# Service management
./docker-manage.sh start     # Start all services
./docker-manage.sh stop      # Stop all services
./docker-manage.sh restart   # Restart all services
./docker-manage.sh status    # Check service status
./docker-manage.sh logs      # View all logs

# Image conversion
./webp-ctl.sh stats         # WebP conversion statistics
./avif-ctl.sh stats         # AVIF conversion statistics
./webp-ctl.sh rescan        # Trigger directory rescan

βš™οΈ Configuration

Image Quality Settings

# docker-compose.yml
WEBP_QUALITY=85          # WebP quality (1-100)
AVIF_QUALITY=80          # AVIF quality (1-100)
WEBP_WORKER_THREADS=12   # Async workers
WEBP_RATE_LIMIT=500      # Files per minute

Supported Formats

  • Input: JPG, JPEG, PNG, GIF, BMP
  • Output: WebP, AVIF
  • Min Size: 10KB (configurable)

πŸ”§ Production Features

High Availability

  • Health checks for all services
  • Auto-restart on failure
  • Read-only containers for security
  • Resource limits and monitoring

Security

  • No new privileges security option
  • Read-only filesystem for containers
  • Rate limiting (100 req/sec per IP)
  • CORS headers for cross-origin requests

Performance

  • Async processing with 12 workers
  • Queue management (10,000 items max)
  • Batch processing (50 files per batch)
  • Smart caching with immutable headers

πŸ“ˆ Monitoring Dashboards

  • CDN Performance: Request rates, response times, cache hit ratios
  • Image Conversion: WebP/AVIF conversion statistics
  • System Health: CPU, memory, disk usage
  • Alerts: Automatic notifications for issues

🎯 Use Cases

  • E-commerce: Faster product image loading
  • News sites: Optimized article images
  • Corporate sites: Reduced bandwidth costs
  • High-traffic: Scalable image delivery

πŸ“‹ Requirements

  • Docker 20.10+
  • Docker Compose 2.0+
  • 4GB RAM minimum
  • 10GB disk for image cache

πŸ“„ License

MIT License - see LICENSE file


Made with ❀️ by AAChibilyaev

About

πŸš€ Π’Ρ‹ΡΠΎΠΊΠΎΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ CDN для Битрикс с автоматичСской WebP ΠΊΠΎΠ½Π²Π΅Ρ€Ρ‚Π°Ρ†ΠΈΠ΅ΠΉ | High-performance CDN for Bitrix with automatic WebP conversion

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •