Recently selecting Aggregate and compress CSS files or Aggregate JavaScript files in the Performance page stopped working on a Drupal 7 site: When they are selected, the CSS/JavaScript file won't load.
I have cloned the site on another server and the problem doesn't occur there. The PHP version and the Drupal version (7.89) is the same.
How can I debug what is going on here?
Edit: Additional info
As I mentioned in the comments, the aggregated CSS files are not viewable in the browser. However, If I change the filename to e.g. test.css, it then is viewable.
Further:
Each aggregate file has a corresponding .gz of the same name. When I delete this the .css file is then viewable via the browser. So it looks like the issue has something to with these .gz files.
/sites/default/files
folder has the correct folder owner and group besides having the appropriatechmod 755
permissions.