ministryofjustice / justice-gov-uk

Justice UK website
https://www.justice.gov.uk/
MIT License
2 stars 0 forks source link

Disable CONCATENATE_SCRIPTS, COMPRESS_CSS & COMPRESS_SCRIPTS #189

Closed EarthlingDavey closed 5 months ago

EarthlingDavey commented 5 months ago

The endpoints: load-scripts.php and load-styles.php are used by WP to concatenate and compress assets at runtime. Since we are using nginx, these assets can be served via nginx instead.

This PR makes the following changes:

This code is difficult to test locally because Config::define('SCRIPT_DEBUG', true); in config/environments/development.php means that scripts are not concatenated. Temporarily disable this and access an admin page locally to see CONCATENATE_SCRIPTS in action.

This should have the effect of fixing the intermittent CPU spikes. If not, it is still good practice :)

Further reading: