Support Home > Troubleshooting Concatenated CSS or JavaScript Delivery Methods

Troubleshooting Concatenated CSS or JavaScript Delivery Methods

This article explains how Jetpack Boost delivers concatenated CSS and JavaScript files and how to troubleshoot issues related to direct delivery and fallback methods.

Jetpack Boost (v3.9.0 and later) optimizes WordPress performance by concatenating and minifying CSS and JavaScript files, delivering them directly from your web server for faster load times.

When direct delivery isn’t possible, a fallback system using PHP ensures content is still accessible while optimization efforts continue.

How to check which delivery method is in use

To determine which delivery method your site is currently using, follow the steps:

  1. Open a page on your website in a browser.
  2. View the page source (right-click → View page source).
  3. Look for CSS or JavaScript file URLs:
    • If they are loaded from /wp-content/boost-cache/static/, congratulations! Your site is already set up for direct delivery of these files.
    • If they are served from /_jb_static/, it means WordPress is handling the delivery, which may slow down requests slightly as PHP processes these files. While concatenating multiple files into one is generally beneficial, you may want to explore why direct delivery isn’t functioning on your website.

Jetpack Boost relies on WordPress’s custom permalinks system to regenerate these concatenated files. If a file is missing, WordPress detects the issue, triggering a regeneration process in Jetpack Boost. The plugin periodically checks if WordPress detects missing files in the wp-content directory. If this check fails, files are served using the /_jb_static/ method via PHP.

Manual Testing

If your site is using /_jb_static/ to serve the concatenated files, you can perform a manual test by attempting to access a non-existent URL within the /wp-content directory. It should look like a file the plugin uses, such as /wp-content/boost-cache/static/1234.css. Look for a WordPress 404 error page. If, instead, you see a standard web server 404 error, this confirms there is an issue requiring resolution.

When does the automatic 404 test run?

The plugin performs a check when both Concatenate modules (JS and CSS) are disabled, and you enable one of them. It also runs once daily. This ensures ongoing monitoring of your site’s performance and file delivery mechanisms.

How to fix issues with wp-content

The issue likely stems from the underlying web server configurations tied to custom permalinks.

Fixing on Apache

On Apache servers, mod_rewrite rules manage this, which may be disabled in the wp-content directory. Check for a hidden .htaccess file within the wp-content directory. If present, look for the following directive:

RewriteEngine Off

Removing or commenting out this line may resolve the issue. However, if you’re unfamiliar with these configurations, contact your hosting provider for assistance.

If there is no .htaccess file in the wp-content directory, your hosting provider may have disabled the web server settings this plugin relies on. If that is the case, the plugin will fall back to using WordPress techniques to serve the concatenated CSS or JavaScript. It is slightly slower, but it is still beneficial to your website.

Fixing on non-Apache Servers

For non-Apache servers like Nginx, consult your server’s documentation or contact your hosting provider for guidance on modifying configuration files in /etc/nginx/.

Disable 404 testing

To disable the is_404() testing, define the constant JETPACK_BOOST_DISABLE_404_TESTER in an mu-plugin. Here is an example of how to set that constant.

<?php

if ( ! defined( 'JETPACK_BOOST_DISABLE_404_TESTER' ) ) {
    define( 'JETPACK_BOOST_DISABLE_404_TESTER', 1 )
}

After disabling the tester, and if you are certain that is_404() works in the wp-content directory, you can set the jetpack_boost_static_minification site option to 1. Set it to 0 to use the older way of serving these files.

Conclusion

It’s highly likely that the presence of a .htaccess file in your /wp-content directory is causing this issue. Addressing this configuration should resolve the problem and restore expected 404 test behavior. This adjustment will help ensure your files are being delivered as efficiently as possible, improving both performance and functionality.

Still need help?

Please contact support. We’re happy to advise.

  • Table Of Contents

  • Contact Us

    Need more help? Feel free to contact us.