English 中文(简体)
2. 自我面面面面面孔导致绩效问题
原标题:font face causes performance issues

当我的现场负荷时,在浏览器显示用字面直立的文字之前,先冻结了几秒钟(斜体的文字立即显示)。

I ve been getting complaints from users that experience a freeze of up to 10 seconds.

我可以做些什么?

下面是我如何插入字面:

@font-face{
    font-family: GillSans ;
    src:url( ../fonts/GIL_____.eot );
    src:url( ../fonts/GIL_____.eot?#iefix ) format( embedded-opentype ),
        url( ../fonts/GIL_____.woff ) format( woff ),
        url( ../fonts/GIL_____.ttf ) format( truetype ),
        url( ../fonts/GIL_____.svg#GillSans ) format( svg );
}
@font-face{
    font-family: GillSansB ;
    src:url( ../fonts/GILB____.eot );
    src:url( ../fonts/GILB____.eot?#iefix ) format( embedded-opentype ),
        url( ../fonts/GILB____.woff ) format( woff ),
        url( ../fonts/GILB____.ttf ) format( truetype ),
        url( ../fonts/GILB____.svg#GillSansB ) format( svg );
}
@font-face{
    font-family: GillSansBI ;
    src:url( ../fonts/GILBI___.eot );
    src:url( ../fonts/GILBI___.eot?#iefix ) format( embedded-opentype ),
        url( ../fonts/GILBI___.woff ) format( woff ),
        url( ../fonts/GILBI___.ttf ) format( truetype ),
        url( ../fonts/GILBI___.svg#GillSansBI ) format( svg );
}
@font-face{
    font-family: GillSansI ;
    src:url( ../fonts/GILI____.eot );
    src:url( ../fonts/GILI____.eot?#iefix ) format( embedded-opentype ),
        url( ../fonts/GILI____.woff ) format( woff ),
        url( ../fonts/GILI____.ttf ) format( truetype ),
        url( ../fonts/GILI____.svg#GillSansI ) format( svg );
}
最佳回答

T和ach。 如果你使用阿帕奇的话,你可以利用“htaccess”混淆。

http://www.stevesouders.com/blog/2009/10/13/font-face-and- Performance/“rel=“nofollow” Steve Sounders

<>附加信息与资源

http://d.apache.org/docs/2.0/mod/mod_expires.html 您可以加入以下规则。

<IfModule mod_expires.c>
  Header set cache-control: public
  ExpiresActive on

  ExpiresByType font/ttf      "access plus 1 month"
  ExpiresByType font/woff     "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

<IfModule mod_deflate.c>
  <FilesMatch ".(ttf|otf|eot|svg)$" >
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>

在将上述内容添加到(htaccess)之后,观察了相关的主角,以核实。

如果你有兴趣学习更多,请查看rel=“nofollow”>和 rel=“nofollow”compression

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签