XF 2.3 CSS still bundled with HTTP/2.0

Tumpe

Member
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.
I've upgrade our test installation with success, but this isn't working like it should? We still get individual css files bundled together. Created a whole new blank default style and same happens there too.

I checked another XF project I've worked on and while the 2.3 upgrade was very successful, I just noticed that the same bundling happens there too. And then on another project's test installation (upgraded to 2.3) the CSS files are NOT bundled. HTTP/2 is enabled on all of those installations.

No outdated templates - and the new style I created naturally wouldn't have that issue.
 
Solution
PHP:
$config['enableCssSplitting'] = true;

The default value is null to auto-detect HTTP/2+ which obviously doesn't work behind a HTTP/1.1 reverse proxy.
I don't really have anything to go on but, indeed, your current live site running 2.2 seems to be serving HTTP/2.0 so I would expect it to work.

The exception would be if the correct SERVER_PROTOCOL is not being passed through to PHP for some reason.

To test that, I would recommend creating a file in your web root temporarily named http_version.php with the following content:

PHP:
<?php

use XF\App;

$dir = __DIR__;
require $dir . '/src/XF.php';

\XF::start($dir);
$app = \XF::setupApp(App::class);

\XF::dumpSimple($app->request()->getServer('SERVER_PROTOCOL'));

Then access http_version.php and you're supposed to see something like:

Code:
string(8) "HTTP/2.0"

Let us know what that says.
 
Back
Top Bottom