Worse still, I’m loading woocommerce.css via CDN OK, using AWS CloudFront, but that file requests .ttf and .woff files using a relative address, so they are requested from the CDN, and aren’t supplied, probably because of CORS.
The plugin isn’t requesting the font files, they are relatively addressed from the CSS which is fetched from the CDN. Therefore excluding the font files doesn’t solve it.
So currently I have to exclude the specific CSS file from being service via the CDN.
– or –
CORS headers have to be handled on the server running CDN enabler.
https://tecadmin.net/set-access-control-allow-origin-cors-in-apache/ shows how to set headers.
Also had to enable /mods-available/headers.load in the apache config.
Amazon has help on passing the header through CloudFront: https://aws.amazon.com/premiumsupport/knowledge-center/no-access-control-allow-origin-error/
and https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html
Still didn’t work, even after invalidating the files on CloudFront.
I can verify that my server is including a Access-Control-Allow-Origin header to the font file when CloudFront requests it.
I’m a bit puzzled by the instructions from AWS about request headers. Should the Access_Control header be in the request headers made when the font file is requested?
Anyhow still didn’t work so back to plan A and don’t serve the CSS file via CDN.