-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Audit the website for performance issues #413
Comments
Just noting that lazy loading images (and possibly iframes) is being discussed in #351 |
Yes I definitely think #351 would be helpful. This issue can tell us how significant the perf impact of not lazy loading is. |
In base.html we load the fonts here: I think it's loading one font file for each weight/style combo. |
The home page background image is very large and provides contrast to the white text at the top of the page. Because it's so large, it takes a few seconds to load for the first time, so the text is invisible, except for the yellow buttons: We should use a CSS-based background color as a placeholder until the image loads, and/or look into optimizing that background image so it doesn't load as slowly. |
Images used in the footer and mobile design are loading immediately. Below-fold images should be lazy loaded and mobile-specific images should never load for desktop.
|
Extend the cache lifetime for static images (related #286) |
Mobile-specific data viz is still loaded on desktop chapter pages. I would have thought the
|
Embedded data viz iframes should be lazy loaded until in view (#351). Author avatars should also be lazy loaded. |
|
Also i would add that many resources paths are relative and not absolute. This could make additional time to check protocol / redirect etc. |
Nah, don't think that's the case! Relative paths are gooood. |
You serious ? ^^ |
I'm not aware of any reason not to use relative paths. It doesn't incur any overhead AFAIK. Browsers can quickly canonicalize the URL on the fly. Maybe you're thinking of navigating to a page, for example |
Yes. What's the concern here? You mean it says things like:
As opposed to:
?? |
This is ok but i'm talking about resources paths. I believe that since we should be on HTTPS, it would be better to precise the absolute path. In our case, i don't think it has a visible impact, just a best practice. |
That means don't do this:
As that loads http://www.google-analytics.com/analytics.js when on HTTP version of your site and https://www.google-analytics.com/analytics.js when on HTTPS and better to load same over both as will be referenced in cache for both so saves a double download. Plus better for security (if an assets is available over HTTPS then why not load it over HTTPS!). It has nothing to do with relative references to links on your own site like the examples I gave in #413 (comment) |
Well technically I suppose it it could be same thing if we had mixed site (i.e. some pages on HTTP and some on HTTPS) as, for example, specifying our logo always being loaded over HTTPS even on HTTP would prevent a double download. But since we don't have a mixed site, this is a non-issue. Relative paths allow for cleaner, less-verbose code and launching dev envs while loading assets locally. |
Ok thank you @bazzadp :) |
Oh and btw the title of that page is "No Protocol-Relative URLs" not "No Relative URLs" |
Just opened an issue about the static content TTL and then realized it's already being tracked here - #423. |
This something I'd be interested to work on. Is there a separate issue for this? Also, I'd need the vector source for this file: https://almanac.httparchive.org/static/images/intro-background-fit.png because we also need to make it .svg for HiDPI displays. |
SVG sounds like a good idea. @mikegeyser was also looking into improving the performance of this image. Did you make any progress, Mike? |
In case @mikegeyser needs some help here, I'd recommend turning the
What do you think? |
I'll definitely take a look at doing that @catalinred. The alternative that I was playing around with on Sunday was using a solid background and lazy loading the image and swapping it. It does mean including some javascript to do the switch, however, which I'm not sure about. Seems like it's all tradeoffs... |
@catalinred @rviscomi I pushed what I was working on as a part of #485. I'm really not tied to that way of doing it, and would like feedback. We can embed the image as a data uri directly, and that's simpler, but it does seem as there is a non-trivial tradeoff in making the CSS file larger with image data (although that link is super old). This was is at least still cacheable? Anyway, let me know what you think. :) |
Edit: Ignore me. Getting my issues mixed up. Yes Lazy Loading is sorted. |
No worries. The fix was just deployed live so it's worth rerunning another performance test to validate it. |
I run Lighthouse, Lazy loading seems to work fine now. This image is big (400 KB ! ) to resize + compress. Why not self host contributors avatars ? Erik Nygren's one > 160 KB. Figures images could be lighter on size. |
👌
I thought it did that automatically?
I'm not sure I agree. I think it's nice for people to be able to alter their avatars on GitHub rather than have to do a PR.
We load the 200px version. Now on author pages we only load a 60 x 60 pixel one so that's arguably a bit big. But only one image, that's now lazy-loaded, so not a big deal. However on contributors page we load 100 x 100 and with retina screens, 200 x 200 is probably better. Again they are lazy-loaded so not too concerned. |
Not always :) since it is shuffling on reload |
Contributor is shuffling on reload - not chapters. See my second comment for contributors page 😀 |
Yeah i mean, when Erik Nygren's is displayed on the "Above the fold zone", it won't be lazy loaded. |
Related: #286 and #303. Make sure we're not doing anything silly to hurt performance.
I'm aware that embedding 25 Sheets iframes is probably not a great idea for performance. We can look into preconnecting to the origin and lazy loading the iframes.
The audit should ideally happen before launch just so we know if we're doing anything egregious. Any P0 performance issues should be fixed prior to launch (within 24 hours). Everything else can be resolved after launch (apres ski).
cc performance experts @andydavies @paulcalvano
Performance issues
The text was updated successfully, but these errors were encountered: