• Resolved Mr. Punjab

    (@youngnawab)


    First of all, thank you so much for developing such a simple yet highly useful plugin. It is really useful for sites like mine (integrated with varnish, so caching plugins are mess to use so). The plugin works just seamless with a click, as expected. It can effortlessly enable CDN for images, CSS or JavaScripts. But I was thinking how to instruct plugin to enable CDN for even font files as woff, woff2.

    Is it possible to do so ?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I’ve the same issue.

    Did someone solve this? Any ideas?

    Thank you
    Regards

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Enable CDN for woff, woff2 alike font files’ is closed to new replies.