cdn 字体_从CDN提供字体

为了提高性能,将字体资源放在CDN上。然而,跨域字体在Firefox和IE中需要CORS配置才能正常工作。将Access-Control-Allow-Origin设置为允许所有域或指定域,确保提供所有字体类型以适应浏览器需求。通过curl检查响应头确认配置正确。
摘要由CSDN通过智能技术生成

cdn 字体

For maximum performance, we all know we must put our assets on CDN (another domain).  Along with those assets are custom web fonts.  Unfortunately custom web fonts via CDN (or any cross-domain font request) don't work in Firefox or Internet Explorer (correctly so, by spec) though they do work (incorrectly so) in Webkit-based browsers. They actually require custom CORS configurations to display properly.  Here's the code you'll need to make that happen.

为了获得最佳性能,我们都知道我们必须将资产放在CDN(另一个域)上。 与这些资产一起的是自定义Web字体。 不幸的是,通过CDN定制的Web字体(或任何跨域字体请求)在Firefox或Internet Explorer中(按规范正确地)不起作用,尽管它们在基于Webkit的浏览器中确实(不正确地)起作用。 他们实际上需要自定义的CORS配置才能正确显示。 这是实现该目标所需的代码。

.htaccesshttpd.conf代码 (The .htaccess or httpd.conf Code)

The code can be placed with the .

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值