Improved CSS performance with HTTP/2+
For webservers running HTTP/2 or higher, one of the key advantages is the support for multiplexing. Multiplexing allows for multiple resource requests (like JavaScript and CSS) to be handled concurrently, reducing overhead and boosting page load speeds.
In XenForo 2.3, we've optimized this functionality by refining how CSS requests are made.
- The core CSS, which is consistent across all pages, continues to be bundled into a single request.
- CSS specific to individual templates or pages will now be requested separately, rather than bundled together.
For a clearer representation of these changes, see below.
Before:
HTML:
<link rel="stylesheet" href="css.php?css=public:normalize.css,public:fa.css,public:variations.less,public:core.less,public:app.less" />
<link rel="stylesheet" href="css.php?css=public:node_list.less,public:notices.less,public:share_controls.less,public:extra.less" />
After:
HTML:
<link rel="stylesheet" href="css.php?css=public:normalize.css,public:fa.css,public:variations.less,public:core.less,public:app.less" />
<link rel="stylesheet" href="css.php?css=public:node_list.less" />
<link rel="stylesheet" href="css.php?css=public:notices.less" />
<link rel="stylesheet" href="css.php?css=public:share_controls.less" />
<link rel="stylesheet" href="css.php?css=public:extra.less" />
By making these requests individually and unbundling the CSS from others, this allows the individual templates to be cached and reused more effectively across different pages.