-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
frontend speed improvements - cuts landing page load time by 55% and DOMready time by 35% #4791
Conversation
if/when we merge this we should also merge https://github.com/gitcoinco/web/tree/kevin/site-perf2 |
@danlipert feedback? |
@@ -224,7 +224,7 @@ img.play { | |||
cursor: pointer; | |||
--padding: 40px; | |||
background-color: var(--gc-green-hover); | |||
background-image: url('../images/home/bg-video-preview.svg'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this allows us to load them inline upon scroll instead of on pageload.
@@ -0,0 +1,6 @@ | |||
/*! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the medium images and vue.js images to our own site so they could be cached according to our CDN config..
@@ -441,8 +441,8 @@ <h5 class="bounty-heading">{% trans "Funder" %}</h5> | |||
<script src="/dynamic/js/tokens_dynamic.js"></script> | |||
<script src="{% static "v2/js/tokens.js" %}"></script> | |||
<script src="{% static "v2/js/amounts.js" %}"></script> | |||
<script src="{% static "v2/js/lib/popper.min.js" %}"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in base template now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | ||
{% endif %} | ||
{% include 'shared/sentry.html' %} | ||
<script src="{% static "v2/js/lib/vue.js" %}"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add <script src="https://cdn.jsdelivr.net/npm/vue"></script> to not prod environment ? that is used to debug, so will show the correct vue errors in localhost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -29,8 +29,8 @@ | |||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |||
{% endif %} | |||
{% include 'shared/sentry.html' %} | |||
<script src="{% static "v2/js/lib/popper.min.js" %}"></script> | |||
<script src="{% static "v2/js/lib/bootstrap.min.js" %}" crossorigin="anonymous"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to move bootstrap.js to footer_scripts and footer_scripts_lite since now is used in most parts and is part of the framework.
I had changed that in this PR #4727
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it - maybe we should just have a seperate compress
section here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes for sure we can add it later. In some point we will get in a place we can just use the "lite" version and deprecate the other, but need to check since there are diff parts of the site with diff needs and for example the shared.js is something Im trying to avoid to be loaded in all pages. Maybe having one compress for footer_scripts_lite and one for footer_scripts
{% include 'shared/tag_manager_1.html' %} | ||
<meta charset="utf-8"> | ||
{% compress css %} | ||
<link rel="preload" href="{% static "v2/css/base.css" %}" as="style"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a preload tag, so will try to find that file in the server to pre fetch it. Maybe since will be now a big css file, it should preload that file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it depends on if we want it to block the loading of the rest of the site..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create one file name.css right? I mean <link rel="preload" href="{% static "v2/css/base.css" %}" as="style"> is not the actual call of the file just the instruction to prefetch it. I guess we should have in compress just the files that are loaded in all pages and then add one <link rel="preload" href="{% static "v2/css/compress.css" %}" as="style">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create one file name.css right?
yes
I guess we should have in compress just the files that are loaded in all pages and then add one
i read the docs on this and i dont understand what gain this gives the site.. CSS loading should not block the rendering of theDOM right? AFAIK it happens ineline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I think is not about blocking is about kb that will load minification + concat. For other side I think the most valuable for us is the minification part since we use http2 and the conections to fetch the diff files will be at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the preload what happens is the browser knows the priority of the side and will load as soon as possible avoiding any repaint in the browser side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is a good article showing examples of use of preload https://medium.com/reloading/preload-prefetch-and-priorities-in-chrome-776165961bbf
<link rel="stylesheet" href="{% static "v2/css/jquery.modal.min.css" %}" /> | ||
{% endif %} | ||
<link rel="stylesheet" href="{% static "v2/css/jquery-ui.css" %}" /> | ||
<link rel="stylesheet" href="{% static "v2/css/jquery.modal.min.css" %}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding modal and jquery-ui to all the pages will break a lot of pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does it break? wouldnt pages without a modal / jquery-ui just not activate the features in this css files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jquery-ui modals styles overwrite bootstrap ones because they use general class like .modal
without descendent of special class. There left just a few places where we using jquery-ui the ideas is totally remove it. I think if you open any modal like submit work you will get a messed modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it - is there a task to remove the jquery-ui dependancies? id add some bounty funds to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if there are other features of jquery ui we are using...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just modals and tooltips
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions |
Is this the doc? https://django-compressor.readthedocs.io/en/stable/usage/ |
yes
…On Mon, Jul 15, 2019 at 12:28 PM Octavio Amuchástegui < ***@***.***> wrote:
Some questions
how compressor works?
it runs in dev also?
We can control the generated file name?
Is this the doc? https://django-compressor.readthedocs.io/en/stable/usage/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4791?email_source=notifications&email_token=AAD5PCONCCQL4H2INRBAGPTP7S6VPA5CNFSM4ICTHOAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ6SDAY#issuecomment-511517059>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD5PCJY67P4OVKBTBDQCRTP7S6VPANCNFSM4ICTHOAA>
.
_________________________________________
check out what i'm building on github <http://github.com/owocki>
or what i'm shooting on photoshelter <http://photography.owocki.com/>
or find me on twitter <http://www.twitter.com/owocki>, facebook
<http://www.facebook.com/kevinowocki>, instagram
<http://instagram.com/owocki>, linkedin <http://www.linkedin.com/in/owocki>,
and owocki.com <http://www.owocki.com/?utm_source=emailsig>.
see you around teh internets!
PS -- Come to the next Boulder Blockchain
<https://www.meetup.com/Boulder-Blockchain/> meetup. Be there or be ^ 2.
PPS -- Have I mentioned that *G**itcoin is live?* More @ https://gitcoin.co
|
PR for images: #4800 |
just addressed everyones comments. |
just pushed up one commit.. i think i got evertything |
any other comments? im going to resolve the merge conflicts now i want to apply this to other pages that take too long to load because of frontend issues next.. as long as the group thinks we are going in a directionally correct way |
actually, i probably will just cherry-pick the changes into a new PR with a clean commit history rather than resolve the conflicts here.. |
new PR #4826 |
Closing this out as this is a dupe of #4826 |
Description
up until now, my efforts on site speed have been mostly oriented around HTML generation time. nwo that we've gotten the HTML gen time down, i'm turning my efforts towards focusing more on front-end optimizations.
this is a PR that takes the landing page load time on gitcoin from
to
on the intial page paint, thats:
on a cold cache.
on a warmed cache itll take us from
how
further TODOs
Testing
tested landing page locally