-
Notifications
You must be signed in to change notification settings - Fork 192
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
Enable text compression #2750
Comments
It seems related to #2751 |
Our currently gzip settings are: ##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.0;
# Turn on gzip for all content types that should benefit from it.
gzip_types application/ecmascript;
gzip_types application/javascript;
gzip_types application/json;
gzip_types application/pdf;
gzip_types application/postscript;
gzip_types application/x-javascript;
gzip_types image/svg+xml;
gzip_types text/css;
gzip_types text/csv;
# "gzip_types text/html" is assumed.
gzip_types text/javascript;
gzip_types text/plain;
gzip_types text/xml; We're not doing anything specific to the fonts. The #2751 was specifically to add gzip compression to the server. |
Running this tool will probably help. When I add the fonts to the server I should use |
I was inspecting the fonts we use in webcompat.com and I found that we make two requests to get sourcesanpro webfont. https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Sans+Pro:300,400|PT+Mono P.S.: I can reproduce this in a clean profile on Chrome & also Firefox Nightly. |
home page. no cache. clean profile. so I see a request to:
So This is what is being asked:
which is
This is coming from
Let's check the blame. This was done here ah and in this commit there is a TODO.
|
And the Todo was removed in this commit. |
btw the 3 requests seem to be different links. |
Yeah. They are different. But the content at least from the two pairs I posted seem to be the same. But here is an issue: you have three requests in your devtools while I have four. |
I think I figured it out. |
Here are some changes I propose for our text rendering: Following up from my project. I re-ran pagespeed on webcompat.com and this is the output I got:
Searching more about how to make fonts visible I found some pretty good articles, like this. Here are some +pros and -cons to use @font-face:
I found out that the we should use
I know it only works on Chrome, but I don't see why not to use it. It doesn't do anything bad for performance on Firefox and once we implement this feature again we'll be able to use it.
|
Ok, so I've been running tests with Font face observer and the FOUT effect it produces it's displeasing me a lot. |
This is what I got running tests on a Nexus 5 mobile with an internet speed of 300kbps (a slow 3G connection). It took 4 seconds to load the real font since the first meaningful paint appeared, even longer since the user made the first request to our page. Pretty bad. I've tested in my desktop and it doesn't matter much which internet speed I'm using. I've tested with 500kbps, 1500kbps, 5000kbps and the font only takes a few seconds to load. I think those are reasonable speeds to test the website because according to this rank of world internet speeds the slowest one is 3.73mbs on Desktop. So I think we cover a lot of internets with the range I tested. While in mobile this is a relevant upgrade to our performance it doesn't mean so much for desktop users. I was thinking that it'd be simpler if I just made this change for mobile users and not for the desktop users. It doesn't matter how hard I try the FOUT thing will still be perceivable and I don't think it's worth it to add this ugly thing to our website when we're only saving a couple of ms. |
You mean about FOUT? |
Yes @magsout. What do you think? |
Reminder: in case #2809 doesn't land I should subset our fonts because it significantly decrease the size of the font files vide #2809 (comment). This is what we currently use: U+20,U+21,U+27,U+2A,U+2C-2E,U+30-32,U+34-36,U+38-3A,U+3F,U+41-4A,U+4C-59,U+61-7A,U+2014,U+2019,U+1F389 |
@marimeireles the better way to decrease the FOUT effect is to improve the font download. I mean, the FOUT |
@marimeireles it's exactly what you are doing there #2809 Sometimes, is better to host our font instead of Google (because of delivrability, latency etc..) |
Good to know! That's what I'm testing now. |
According to Karl this is an awful subset of things. |
I was running some profilers and PageSpeed gave me this result:
I've already wrote a little bit about how to do that on my proposal. It might be a good thing to start from these sources.
If PageSpeed is telling the true than we can get huge improvements for mobile users. As big as the ones removing markdown-it will do.
This is somewhat related to #2747 because there are some alternatives of doing this on the server side.
The text was updated successfully, but these errors were encountered: