While setting up the domain for this blog in CloudFlare, I quickly went with YES to the optimization features they offered, among which is minifying the content served.
Some time later I noticed my CSS/JS wasn't loading and this error was showing up in the console:
Failed to find a valid digest in the 'integrity' attribute for resource '...'. The resource has been blocked.
Subresource integrity embeds a hash of the included asset (css/js) into the integrity
attribute like so:
<link href="/assets/css/stylesheet.min.4f1ad98d0.css"
integrity="sha256-TxrZjQu8UeoslQ8GPH4pUivIlFyd0GNIMYzUzOa+RLs=">
If I'd enable Developer Mode the problem would disappear. Looking over the
HTTP headers, I noticed this cf-polished
header which reminded me of the optimization settings.
Fixed it by disabling the CF-side optimizations which were of not much benefit since Hugo can handle minification on it's own. 👌
Alternatively I could just disable fingerprinting in the Hugo config. But it's actually quite nice, I'll have it!