Skip to content
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

Support inlining CSS for a performance boost. #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adworacz
Copy link
Contributor

Can reduce First Content Paint time and overall download size for a
single page. This is useful for sites where often only one page is
visited by a user. In such a case, separately loading/caching the CSS
provides no extra benefit, and slows down content rendering while
waiting the CSS network request to start and finish.

Additionally, when using a decent compression algorithm like Brotli, the
total number of bytes sent over the wire can drop a bit. In my testing,
I saw total CSS + HTML size drop by 0.17KB, or ~2.5%.

Original idea taken from "Lightspeed" Zola theme:
https://github.com/carpetscheme/lightspeed/blob/master/templates/index.html#L15-L16

Can reduce First Content Paint time and overall download size for a
single page. This is useful for sites where often only one page is
visited by a user. In such a case, separately loading/caching the CSS
provides no extra benefit, and slows down content rendering while
waiting the CSS network request to start and finish.

Additionally, when using a decent compression algorithm like Brotli, the
total number of bytes sent over the wire can drop a bit. In my testing,
I saw total CSS + HTML size drop by 0.17KB, or ~2.5%.

Original idea taken from "Lightspeed" Zola theme:
https://github.com/carpetscheme/lightspeed/blob/master/templates/index.html#L15-L16
@vercel
Copy link

vercel bot commented May 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ejmg/zerm/iVr2zWW3n1cUzWfmzNqXq8DnTpV6
✅ Preview: https://zerm-git-fork-adworacz-inlinecss-ejmg.vercel.app

config.toml Show resolved Hide resolved
Co-authored-by: elias <elias.jm.garcia@gmail.com>
@ejmg
Copy link
Owner

ejmg commented Jul 29, 2021

whoops, looks like merging #20 gave a conflict. if you get the chance to resolve it, we're good to close up your final outstanding PR!

@adworacz
Copy link
Contributor Author

adworacz commented Aug 7, 2021

Sounds good - will fix this conflict in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants