
From 70% to 94%: How We Turbocharged Apache2 Without External Solutions
TL;DR: We achieved a 94% GTMetrix performance score using only Apache2 optimizations—no nginx reverse proxy, no Varnish caching, no LiteSpeed migration. Here's our complete journey from a sluggish 70% to blazing-fast 94%.
The Challenge: Apache2 Gets No Respect
Everyone tells you Apache2 is "slow" and "outdated." The common advice? "Just put nginx in front" or "switch to LiteSpeed." But what if your application is deeply integrated with Apache's ecosystem? What if you want to prove that Apache2 can compete with modern web servers?
That's exactly what we set out to do with ENGINYRING.com—and the results speak for themselves.
Starting Point: The Performance Audit
Our initial GTMetrix scores were embarrassing:
- Performance: 70%
- LCP (Largest Contentful Paint): 6.5 seconds
- FCP (First Contentful Paint): 5.0 seconds
- Total Blocking Time: 280ms
The culprits were obvious:
- Uncompressed assets weighing down load times
- Render-blocking CSS and JavaScript
- Inefficient image delivery
- Poor caching strategies
- Outdated Apache configuration
Phase 1: The Foundation - MPM and PHP-FPM Migration
Problem: Apache's default Prefork MPM creates a separate process for each request, consuming massive memory and limiting concurrency.
Solution: Switch to Event MPM with PHP-FPM.
# /etc/apache2/apache2.conf
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
ThreadLimit 64
ServerLimit 16
AsyncRequestWorkerFactor 2
</IfModule>
This single change reduced memory usage by 60% and enabled HTTP/2 support—critical for modern web performance.
Impact: Immediate 15% performance boost, laying groundwork for HTTP/2 optimizations.
Phase 2: Compression That Actually Compresses
Problem: Default gzip compression is fine, but we wanted maximum efficiency.
Solution: Ultra-aggressive Brotli compression with quality level 11.
<IfModule mod_brotli.c>
BrotliCompressionQuality 11
BrotliCompressionWindow 24
BrotliAlterETag AddSuffix
AddOutputFilterByType BROTLI_COMPRESS text/html text/css text/javascript
AddOutputFilterByType BROTLI_COMPRESS application/javascript application/json
AddOutputFilterByType BROTLI_COMPRESS font/ttf font/woff2 image/svg+xml
</IfModule>
Real-world impact: Our 155KB JavaScript file compressed to 47KB—a 70% reduction. CSS files saw similar gains.
Fallback strategy: We kept maximum-level Deflate compression for browsers without Brotli support:
DeflateCompressionLevel 9
DeflateMemLevel 9
DeflateWindowSize 15
Phase 3: HTTP/2 + Server Push = Magic
With Event MPM in place, we could leverage HTTP/2's multiplexing and server push capabilities.
Protocols h2 http/1.1
H2Push on
H2MaxSessionStreams 100
# Push critical resources before browser requests them
Header add Link "<https://cdn.enginyring.com/css/style.css>;rel=preload;as=style"
Header add Link "<https://cdn.enginyring.com/js/theme.js>;rel=preload;as=script"
Why this matters: Instead of waiting for the browser to parse HTML and discover resources, we push them immediately with the initial response.
Phase 4: PageSpeed Module - The Secret Weapon
PageSpeed is Apache's answer to automatic optimization. We configured it for maximum efficiency:
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRewriteLevel PassThrough
# Image optimization that rivals premium CDNs
ModPagespeedEnableFilters convert_jpeg_to_webp,convert_to_webp_lossless
ModPagespeedEnableFilters rewrite_images,convert_jpeg_to_progressive
ModPagespeedEnableFilters recompress_images,strip_image_color_profile
# CSS/JS optimization
ModPagespeedEnableFilters combine_css,inline_css,rewrite_css
ModPagespeedEnableFilters defer_javascript,prioritize_critical_css
ModPagespeedEnableFilters remove_unused_css,remove_unused_javascript
</IfModule>
Game-changer features:
- Automatic WebP conversion for modern browsers
- Critical CSS extraction and inlining
- Unused code removal
- Progressive JPEG conversion
- Lazy loading implementation
Result: PageSpeed eliminated 178KB of unused JavaScript and 93KB of unused CSS automatically.
Phase 5: Optimized Asset Delivery Architecture
We created a dedicated subdomain-based asset delivery system to separate static content from dynamic pages.
Setup:
cdn.enginyring.com
serves all static assets- Dedicated Apache vhost with asset-specific optimizations
- Custom image processing pipeline through
getimg.php
This approach allowed us to apply aggressive caching strategies and specialized optimizations for different content types while maintaining full control over the asset delivery pipeline.
Phase 6: The Font Loading Optimization
Problem: Google Fonts were causing 780ms of render-blocking time.
Traditional solution: Load fonts asynchronously:
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&display=swap"
media="print" onload="this.media='all'">
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&display=swap"></noscript>
Result: Eliminated 780ms render-blocking time, improving FCP significantly.
Phase 7: Mobile-First Optimization
Mobile performance required special attention:
- Critical resource preloading:
<link rel="preload" as="image" href="https://cdn.enginyring.com/img/photos/hero-bg.jpg">
- Responsive image optimization through PageSpeed:
ModPagespeedEnableFilters responsive_images,resize_rendered_image_dimensions
- Progressive image loading:
ModPagespeedEnableFilters inline_preview_images,lazyload_images
Phase 8: Security + Performance Headers
Performance optimization isn't just about speed—it's about trust and security too.
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header set X-Content-Type-Options "nosniff"
Header set Content-Security-Policy "default-src 'self' https:; script-src 'self' https: 'unsafe-inline' 'unsafe-eval'"
Header set Referrer-Policy "strict-origin-when-cross-origin"
These headers not only improve security but also help browsers make optimization decisions.
The Results: Numbers Don't Lie

Before optimization:
- GTMetrix Performance: 70%
- LCP: 6.5 seconds
- FCP: 5.0 seconds
- Total Blocking Time: 280ms
- Total page size: 2.3MB
After optimization:
- GTMetrix Performance: 94%
- GTMetrix Structure: 95%
- LCP: 1.3 seconds
- Total Blocking Time: 23ms
- Cumulative Layout Shift: 0 (perfect score)
- Total page size: 1.73MB (25% reduction)
Key improvements:
- 400% faster LCP (6.5s → 1.3s)
- 92% reduction in blocking time (280ms → 23ms)
- Perfect layout stability (CLS: 0)
- 25% smaller payload (2.3MB → 1.73MB)

Mobile Performance Breakthrough
The mobile scores were even more impressive:
- Mobile Performance: 86% (up from 45%)
- Mobile LCP: 2.1 seconds (down from 8.2s)
- Cumulative Layout Shift: 0 (perfect score)
Lessons Learned: What Really Moves the Needle
- MPM selection matters more than you think - Event MPM wasn't just about HTTP/2; it fundamentally changed how Apache handles concurrent requests.
- Compression quality vs. CPU trade-off - Brotli quality 11 uses more CPU but the bandwidth savings are massive, especially on mobile networks.
- PageSpeed is underrated - While nginx users reach for external tools, PageSpeed provides enterprise-grade optimization built into Apache.
- Font loading is a performance killer - That innocent Google Fonts link can block rendering for nearly a second.
- Cache headers are free performance - Aggressive caching with proper cache-busting eliminates repeat visitor load times.
The Apache2 Renaissance
This journey proved that Apache2 isn't the slow, outdated server that internet wisdom suggests. With proper configuration, Apache2 can deliver performance that rivals any modern web server.
Key advantages we discovered:
- PageSpeed integration - No external tools needed for optimization
- Mature ecosystem - Decades of modules and documentation
- Configuration flexibility - Fine-grained control over every aspect
- Enterprise stability - Battle-tested under massive loads
Want Similar Results for Your Apache2 Server?
This optimization journey took months of testing, measurement, and fine-tuning. Every configuration change was validated against real-world performance metrics, not theoretical benchmarks.
The techniques we've shared here represent just the highlights—the actual implementation involved dozens of additional optimizations, custom scripts, and monitoring setups.
If you're running Apache2 and want similar performance gains without the trial-and-error process, we offer comprehensive Apache2 optimization services. Our approach is holistic: we don't just copy configurations, we analyze your specific use case, traffic patterns, and performance bottlenecks to create a tailored optimization strategy.
What we deliver:
- Complete Apache2 performance audit
- Custom MPM and PHP-FPM configuration
- PageSpeed optimization for your content
- CDN-style asset delivery setup
- Mobile performance optimization
- Security hardening with performance focus
- Ongoing monitoring and maintenance
Contact us to discuss how we can transform your Apache2 server from a performance bottleneck into a speed demon that rivals any modern web server.
Performance optimization is both science and art. The science is in the measurements and benchmarks; the art is in knowing which optimizations will have the biggest impact for your specific use case. Apache2 might be older than nginx or LiteSpeed, but age brings wisdom—and with the right optimizations, superior performance.