New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline_google_font_css no longer works in Chrome #1040

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 10 comments

Comments

Projects
None yet
3 participants
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Apr 6, 2015

In modern Chrome, visit 
http://www.modpagespeed.com/inline_google_font_css.html?PageSpeedFilters=+inline
_google_font_css

refresh 10 times; you'll always see the non-inlined font CSS and the woff2 font.


Now try this in Firefox: it will inline as expected, with a woff font.

Original issue reported on code.google.com by jmara...@google.com on 5 Jan 2015 at 1:45

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Curiously, if you set Chrome in Nexus 4 emulation mode, you'll get a UA of 

Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) 
AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19

and Chrome/18 does not support woff2, so you'll get a woff, and the CSS will be 
inlined.  This fooled me into thinking the Chrome support was working when I 
first tried it.

Original comment by jmara...@google.com on 5 Jan 2015 at 1:46

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

UA issue in Chrome emulation mode noted as 
https://code.google.com/p/chromium/issues/detail?id=446167

Original comment by jmara...@google.com on 5 Jan 2015 at 2:07

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Much simpler than woff2 or Chrome support; it just needs a much larger inlining 
threshold to work these days, which suggests we may want to have a separate one 
than for just CSS. If you look at e.g.:
http://fonts.googleapis.com/css?family=Roboto
You'll see it's pretty huge since it uses unicode-range: to split it up by 
scripts


Original comment by morlov...@google.com on 6 Jan 2015 at 3:33

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Ah good.

So the first thing we should do is change modpagespeed.com's setup so it 
inlines the fonts references on Chrome.  it's bad for the demo to not work :)


Then we should figure out how to make sure the default configuration works for 
the next release.

Original comment by jmara...@google.com on 6 Jan 2015 at 3:36

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Submitted https://code.google.com/p/modpagespeed/source/detail?r=4497 to give 
it a separate knob in trunk, should probably bump the global knob on mps.com, 
though.

Original comment by morlov...@google.com on 9 Jan 2015 at 5:57

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Updated modpagespeed.com's pagespeed.conf as well.

Original comment by morlov...@google.com on 12 Jan 2015 at 6:18

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Its not working for me, not for woff2 and woff fonts. That means problem is 
somewhere else.  I have exactly copied the example html on my staging server 
and added the below configuration (mod_pagespeed version 1.7.30.4-3852), 
atleast it should work for default example then I wil look for my google font 
file

ModPagespeedEnableFilters flatten_css_imports
ModPagespeedCssFlattenMaxBytes 1111024
ModPagespeedEnableFilters inline_google_font_css

What do you mean by adding much inline threshold? which configuration are you 
referring?
My site is already running stable with more than basic pagespeed  
configuration, www.edudemic.com

Original comment by shashank...@intelligent.com on 21 Jan 2015 at 7:34

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Actually, we are using downstream cache that's why it is not working.
So is there any way to remove CSS font render blocking? any work around?

Original comment by shashank...@intelligent.com on 21 Jan 2015 at 8:15

crowell added a commit that referenced this issue May 11, 2015

Use a separate setting for CSS font inlining threshold (with a larger…
… default),

since current for-Chrome CSS produced by fonts.g.c is quite large.

Addresses https://code.google.com/p/modpagespeed/issues/detail?id=1040
issue #1040

backported from f62b555

@jeffkaufman jeffkaufman changed the title inline_google_font_css no longer works in Chrome inline_google_font_css doesn't work in Chrome Jul 27, 2015

@jeffkaufman jeffkaufman changed the title inline_google_font_css doesn't work in Chrome inline_google_font_css no longer work in Chrome Jul 27, 2015

@jeffkaufman jeffkaufman changed the title inline_google_font_css no longer work in Chrome inline_google_font_css no longer works in Chrome Jul 27, 2015

@Faycal79

This comment has been minimized.

Copy link

Faycal79 commented Mar 9, 2016

Hi,
I have the same issue on apache 2.2 and pagespeed 1.9.

The same problem is on the example:
http://www.modpagespeed.com/inline_google_font_css.html?PageSpeed=on&PageSpeedFilters=inline_google_font_css

What is the solution? Using local storage for caching fonts?

@morlovich

This comment has been minimized.

Copy link
Contributor

morlovich commented Mar 9, 2016

We just had a regression in this triggered by a change in the server end.
There is a fix in
0e79a08

(but not sure if a next 1.9 point release is planned). ... but a
workaround may be to make your webpage use an explicit
utf8 encoding (we sometimes can't see one set via header add or the like,
though), and that may break stuff if it's using
a different charset...

On Wed, Mar 9, 2016 at 6:35 AM, Faycal79 notifications@github.com wrote:

Hi,
I have the same issue. I have apache 2.2 and pagespeed 1.9.

The same problem is on the example:

http://www.modpagespeed.com/inline_google_font_css.html?PageSpeed=on&PageSpeedFilters=inline_google_font_css

What is the solution? Using local storage for caching fonts?


Reply to this email directly or view it on GitHub
#1040 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment