This update fully encapsulates three switchable CSS resource loading modes to fit performance optimization and style loading requirements for different websites. All modes feature clear logic and full compatibility with all XenForo runtime environments:
1. All in One Mode
Automatically merges and compresses all site styles into
one single static CSS file. Only one CSS HTTP request is required per page, drastically reducing HTTP requests and delivering optimal loading speed for performance-focused sites.
2. Part CSS Mode
Adopts a dual-file import structure, loading only
merge.css (core merged styles) together with other supporting static style files. This mode balances resource merging granularity and loading flexibility, achieving the best trade-off between performance and compatibility for most standard websites.
3. Split CSS Mode
Completely refactors the native dynamic css.php request structure. All previously dynamically rendered styles are generated as
individual static CSS files. It retains the advantages of split loading architecture while eliminating all dynamic parsing overhead. All style resources are requested and cached as static files, ideal for custom sites requiring refined and on-demand style loading.
Optimization Highlights | Advantages
- Performance Improvement: Eliminates PHP dynamic parsing overhead for CSS. Static files support long-term caching by browsers and CDNs, significantly reducing server CPU and memory usage.
- Flexible Modes: Three switchable loading modes support extreme speed optimization, balanced compatibility, and refined split loading for various website scenarios.
- Native Compatibility: Seamlessly integrates with the native XenForo architecture without overriding core style logic, causing no conflicts and requiring no template modifications.
- Higher Stability: Standardized static file generation mechanism ensures more stable style loading and effectively fixes common issues such as cache anomalies and loading delays caused by dynamic rendering.