Reference: This article draws on and expands the findings of ENGINYRING.com’s original technical report, providing additional analysis and context for a broader technical audience.
Why Apache2 Deserves a Second Look
For years, Apache2 has been dismissed in web performance circles. Forums and sysadmin Slack channels are filled with suggestions to switch to nginx, reverse proxy with Varnish, or migrate to LiteSpeed. But not every infrastructure or application can abandon Apache so easily—whether for technical reasons, legacy code, or organizational inertia.
The recent optimization work done by ENGINYRING.com puts these assumptions to the test. By focusing strictly on in-place Apache2 enhancements, and eschewing external caching layers or server swaps, they demonstrated just how much performance is locked away in default Apache installations.
Initial Audit: Identifying the Pain Points
Before optimization, ENGINYRING.com’s performance lagged by modern standards:
- GTMetrix: 70% performance
- LCP: 6.5 seconds
- FCP: 5.0 seconds
- Total Blocking Time: 280ms
- Total Payload: 2.3MB
Key issues included large, uncompressed assets, blocking CSS/JS, image inefficiencies, suboptimal cache settings, and an out-of-date server configuration.
Key Optimization Steps & Their Technical Rationale
1. Moving to Event MPM and PHP-FPM
Traditional Apache deployments often rely on Prefork MPM, which isn’t optimized for high concurrency or modern workloads. By switching to Event MPM and PHP-FPM, ENGINYRING.com leveraged a more scalable threading model, reducing resource consumption and enabling HTTP/2.
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
ThreadLimit 64
ServerLimit 16
AsyncRequestWorkerFactor 2
</IfModule>
Impact: Memory usage dropped by 60%, and the groundwork was set for future protocol and performance enhancements.
2. Superior Compression: Brotli and Deflate Tweaks
Compression directly affects bandwidth and load speed. The ENGINYRING.com team implemented Brotli at its highest quality for supporting browsers, while keeping top-level Deflate as a fallback for older clients. The outcome: drastically smaller JS and CSS payloads.
<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>
DeflateCompressionLevel 9
DeflateMemLevel 9
DeflateWindowSize 15
Notable Result: A 155KB JS file was reduced to only 47KB—a remarkable improvement, though admins should note the CPU cost at higher compression levels.
3. Implementing HTTP/2 and Server Push
Once Event MPM was in place, ENGINYRING.com activated HTTP/2 with server push. This allowed them to proactively send critical CSS and JS to browsers, reducing wait times and improving paint metrics.
Protocols h2 http/1.1
H2Push on
H2MaxSessionStreams 100
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"
Technical note: While server push is powerful, it should be reserved for assets that are always needed on initial render.
4. Leveraging the Google PageSpeed Module
Apache’s PageSpeed module is often overlooked but highly effective. It can automate image conversion (to WebP, progressive JPEG), inline and minify CSS/JS, remove unused code, and more. ENGINYRING.com’s configuration included an extensive set of filters for both images and stylesheets.
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRewriteLevel PassThrough
ModPagespeedEnableFilters convert_jpeg_to_webp,convert_to_webp_lossless
ModPagespeedEnableFilters rewrite_images,convert_jpeg_to_progressive
ModPagespeedEnableFilters recompress_images,strip_image_color_profile
ModPagespeedEnableFilters combine_css,inline_css,rewrite_css
ModPagespeedEnableFilters defer_javascript,prioritize_critical_css
ModPagespeedEnableFilters remove_unused_css,remove_unused_javascript
</IfModule>
Result: Over 170KB of unused JS and 90KB of unused CSS eliminated automatically, with images optimized for next-gen formats.
5. Dedicated Static Asset Delivery
All static files (images, CSS, JavaScript) were offloaded to a dedicated subdomain with a custom vhost and asset pipeline. This enabled ENGINYRING.com to apply tailored caching, leverage parallel HTTP/2 connections, and isolate static traffic from dynamic content delivery.
cdn.enginyring.com
serves static files- Specialized caching rules per asset type
- On-the-fly image processing via
getimg.php
Benefit: Faster, more predictable asset delivery, and simpler cache invalidation strategies.
6. Optimizing Web Font Delivery
To prevent Google Fonts from delaying first render, ENGINYRING.com used async loading with preconnect and a print media hack, ensuring fonts did not block the critical path:
<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>
Outcome: Approximately 780ms of render-blocking time was eliminated, improving FCP noticeably.
7. Tailoring for Mobile Users
Recognizing the unique challenges of mobile performance, ENGINYRING.com implemented critical resource preloading, PageSpeed-powered responsive images, and progressive/lazy image loading for optimal results on smartphones and tablets.
<link rel="preload" as="image" href="https://cdn.enginyring.com/img/photos/hero-bg.jpg">
ModPagespeedEnableFilters responsive_images,resize_rendered_image_dimensions
ModPagespeedEnableFilters inline_preview_images,lazyload_images
Mobile Results: Mobile LCP fell from 8.2 seconds to 2.1 seconds, with the mobile performance score nearly doubling.
8. Security and Performance Headers
In addition to speed, security headers were set to improve trust and browser handling:
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"
Advice: Fine-tune CSP rules for your specific JS/CSS usage to avoid breaking site functionality.
Performance: Before & After
The transformation was dramatic. Key performance improvements included:
- GTMetrix Score: 94% (previously 70%)
- LCP: 1.3s (was 6.5s)
- Total Blocking Time: 23ms (was 280ms)
- Page Size: 1.73MB (25% smaller)
- Mobile Score: 86% (from 45%)
- Mobile LCP: 2.1s (from 8.2s)
- CLS: 0 (perfect stability)


Key Lessons for Webmasters Running Apache2
- Modern Apache configurations can rival or outperform newer servers when properly tuned.
- Advanced compression (Brotli), asset splitting, and automated optimizations (PageSpeed) are underused but powerful.
- Mobile optimization must be a first-class concern, not an afterthought.
- There’s no silver bullet—every site needs tailored tuning and real-world benchmarking.
Conclusion: Apache2’s Revival is a Configuration Away
The ENGINYRING.com experience (read their detailed case study) challenges the idea that Apache2 is inherently slow or outdated. By targeting real bottlenecks, using modern modules, and rigorously measuring outcomes, they transformed a sluggish server into a high-performer—without offloading to external solutions or paying for premium alternatives.
For administrators running Apache2 in 2025 and beyond, this case stands as a proof point that performance is about engineering, not just technology choices. Revisit your configurations, measure, and never settle for default speeds.
Read the full original breakdown: ENGINYRING.com – From 70% to 94%: How We Turbocharged Apache2 Without External Solutions