我正在使用@ font-face,当我的@ font-face服务提供商关闭时,我的页面被阻止下载。 (所有请求都显着减慢到仅在请求font-face提供程序的.css文件时爬行,并且当服务提供程序的.css顺利加载时不会发生这种情况)
我读过的所有内容都表明,这只应该发生在IE中,并且只有在css调用之上有标记时才会发生。 但是,我在Webkit浏览器上遇到这个问题,我确信在任何脚本标记之前调用css文件。
还有其他人遇到过这个问题吗? 你知道是什么导致它或如何减轻它吗?
I am using @font-face and my page is being blocked from downloading when my @font-face service provider goes down. ( All requests significantly slow down to a crawl ONLY at the point that the font-face provider's .css file is being requested and this does not occur when the service provider's .css loads smoothly )
Everything I have read suggests that this should ONLY happen in IE and only when there is a tag above the css call. However, I am encountering this problem on Webkit browsers and I am being sure to call the css file prior to any script tags.
Has anyone else encountered this problem? Do you know what could be causing it or how to alleviate it?
最满意答案
对于任何碰到这个的人。 答案归结为浏览器如何解析和加载CSS。 浏览器将在呈现页面之前等待加载所有css。 由于css / font主机的服务器很慢,它阻止了我的页面呈现。
我的解决方案是通过一个比字体托管公司更可靠的cdn服务来托管字体。
For anybody running into this. The answer boils down to how CSS is parsed and loaded by browsers. Browsers will wait for all css to be loaded before rendering a page. Since the css/font host's servers were slow, it was blocking my page from rendering.
My solution was to host the fonts through a cdn service that was much more reliable than the font hosting company.
更多推荐
发布评论