Has anyone had any success using inline_google_font_css?

718 views
Skip to first unread message

Glenn Slaven

unread,
Nov 13, 2013, 9:03:12 AM11/13/13
to ngx-pagesp...@googlegroups.com
I was trying to use the new Inline Google Fonts CSS filter https://developers.google.com/speed/pagespeed/module/filter-css-inline-google-fonts but it's just not working.  I've got nothing in my error log saying why other than

Glenn

Maksim Orlovich

unread,
Nov 13, 2013, 9:28:11 AM11/13/13
to ngx-pagesp...@googlegroups.com
Thank you for trying this.
Looks like there a couple things going wrong:
1) We have an embarassing bug in handling of protocol-relative URLs.
2) You may need to bump CssInlineMaxBytes for this to work.
(which might not be desirable in general; I guess your example
answers whether we need a separate knob for just the font CSS)
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

Glenn Slaven

unread,
Nov 13, 2013, 6:09:35 PM11/13/13
to ngx-pagesp...@googlegroups.com
Hi Maksim, 

I tried changing the link url to have the scheme specified, this didn't work either.  So I then upped the CssInlineMaxBytes to 5000 (which is bigger than the 2.7kb of the linked CSS file) this still didn't work unfortunately.

Glenn
--
Glenn Slaven
Principal Engineer

Ph: (02) 9119 0444
M: 0433 826 255

Maksim Orlovich

unread,
Nov 14, 2013, 10:59:37 AM11/14/13
to ngx-pagesp...@googlegroups.com
Weird. Just tried (in a version that has a candidate fix for the schema bug) w/ a 4K limit and it worked
fine. Hmm, did you fix the schema to https://? We currently can't fetch SSL on nginx 
(of course, not getting mixed content is a lot more important than this, so if your page is accessible via 
 https that was the right choice).

Thanks,
Maks

Glenn Slaven

unread,
Nov 14, 2013, 4:10:28 PM11/14/13
to ngx-pagesp...@googlegroups.com
No, I changed it to http

Maksim Orlovich

unread,
Nov 15, 2013, 10:41:34 AM11/15/13
to ngx-pagesp...@googlegroups.com
Well, that worked in my tests, not sure what to say.
One more thing I can suggest: you could try adding ?PageSpeedFilters=+debug
to the URL,and see if it says something helpful?

Glenn Slaven

unread,
Nov 15, 2013, 4:42:38 PM11/15/13
to ngx-pagesp...@googlegroups.com
Sorry, I tried that& it didn't say anything

Maksim Orlovich

unread,
Nov 19, 2013, 8:59:32 AM11/19/13
to ngx-pagesp...@googlegroups.com
One more question: are you using pagespeed allow *; or perhaps pagespeed allow fonts.googleapis.com; ? 

Glenn Slaven

unread,
Nov 19, 2013, 6:35:59 PM11/19/13
to ngx-pagesp...@googlegroups.com
No, we're not, do we need that?

Maksim Orlovich

unread,
Nov 20, 2013, 11:05:48 AM11/20/13
to ngx-pagesp...@googlegroups.com
On Tue, Nov 19, 2013 at 6:35 PM, Glenn Slaven <gl...@squixa.com> wrote:
No, we're not, do we need that?

No, and it's a bad idea to use in most circumstances. It's just that we just found that
inline_google_font_css doesn't work with that, so I was wondering whether that was 
the cause for it not working for you. Seems like it's not.

John Freier

unread,
Jun 2, 2015, 1:44:01 AM6/2/15
to ngx-pagesp...@googlegroups.com
I am on Apache 2.4, but I am also still getting this message, has it been fixed or updated or anything?
No permission to rewrite 'http://fonts.googleapis.com/css?family=Exo:700|Roboto:300,400,500,700'

As noted here: https://developers.google.com/speed/pagespeed/module/filter-css-inline-google-fonts 
I don't believe I have "ModifyCachingHeaders" but I am not entirely positive - I don't see anything of the likes in my config. 

Thanks in advance,
John

Jeff Kaufman

unread,
Jun 2, 2015, 7:49:52 AM6/2/15
to Maksim Orlovich, ngx-pagesp...@googlegroups.com
+morlovich
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/d/optout.

JF Lefebvre

unread,
Jul 3, 2015, 5:51:33 AM7/3/15
to ngx-pagesp...@googlegroups.com
I Have the same problem with this configuration
I set ModPagespeedModifyCachingHeaders off 
ModPagespeedCssInlineMaxBytes 5000

If I call my page with ?PageSpeedFilters=+debug :

<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Lato:300,400|Courgette" type="text/css" title=CSS /><!--The preceding resource was not rewritten because its domain (fonts.googleapis.com) is not authorized-->

I try to set ModPagespeedDomain fonts.googleapis.com but no effect

Jeff Kaufman

unread,
Jul 3, 2015, 9:18:04 AM7/3/15
to ngx-pagesp...@googlegroups.com, Maksim Orlovich
Setting Domain for fonts.googleapis.com is not going to work, because
fonts.googleapis.com doesn't run PageSpeed.

Could you share a link to your site?
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/d/optout.

Maksim Orlovich

unread,
Jul 6, 2015, 9:28:43 AM7/6/15
to Jeff Kaufman, ngx-pagesp...@googlegroups.com
Do you have HTTPS fetching on?
Domain-related directives shouldn't be needed.
And I think the debug comment may be coming from regular inline_css (I am seeing it on the example page if I turn on all of debug,inline_css and inline_google_font_css together).



Reply all
Reply to author
Forward
0 new messages