diff options
author | Bradley Taunt <bt@btxx.org> | 2024-06-10 09:41:25 -0400 |
---|---|---|
committer | Bradley Taunt <bt@btxx.org> | 2024-06-10 09:41:25 -0400 |
commit | 07e4a2dafe248280b5610f8c7d09b0f30b530f54 (patch) | |
tree | 8a145d1d4d07e1278a837ff15dadccc322d27515 /build/chasing-performance/index.html | |
parent | 16d28628aca9b2d356de31c319f5e7bc0f5b2b02 (diff) |
Initial modifications to rebuilt only changed files based on mod date, performance updates
Diffstat (limited to 'build/chasing-performance/index.html')
-rw-r--r-- | build/chasing-performance/index.html | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/build/chasing-performance/index.html b/build/chasing-performance/index.html deleted file mode 100644 index fa4a914..0000000 --- a/build/chasing-performance/index.html +++ /dev/null @@ -1,133 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="color-scheme" content="dark light"> - <link rel="icon" href="data:,"> - <title>Chasing Performance</title> - <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" /> - <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="RSS feed for blog posts" /> -<style>*{box-sizing:border-box;}body{font-family:sans-serif;line-height:1.33;margin:0 auto;max-width:650px;padding:1rem;}blockquote{background:rgba(0,0,0,0.1);border-left:4px solid;padding-left:5px;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style> -</head> - -<nav> - <a href="#menu">Menu ↓</a> -</nav> - -<main> -<h1 id="chasing-performance">Chasing Performance</h1> -<p>2017-11-20</p> -<h2 id="update">Update</h2> -<p>This post is no longer relevant since this blog has been redesigned since. I’m keeping this article up as a point of reference.</p> -<hr/> -<p>So I decided to participate in Smashing Mag’s Front End Performance Challenge, not only for the potential of winning the prize but to further experiment with optimizing my site. (Web performance is a passion of mine)</p> -<p>Below I will breakdown the before & after statistics of my personal site and what changes I made in great detail.</p> -<p>I will be using both my homepage and the image-heavy article I recently wrote, The Death of Personality, as the basis for my tests.</p> -<h3 id="lighthouse-score---homepage">Lighthouse Score - Homepage</h3> -<p>Full source original stats // Full source updated stats</p> -<h3 id="lighthouse-score---article-page">Lighthouse Score - Article Page</h3> -<p>Full source original stats // Full source updated stats</p> -<h3 id="web-page-test---homepage">Web Page Test - Homepage</h3> -<p>Full source original stats // Full source updated stats</p> -<h3 id="web-page-test---article-page">Web Page Test - Article Page</h3> -<p>Full source original stats // Full source updated stats</p> -<h3 id="quick-look">Quick Look</h3> -<p>Though my homepage only made some minor speed performance enhancements, my article post’s initial load time was slimmed down by a <strong>whopping 4.2 seconds!</strong> That’s pretty incredible and very noticeable from an end-user’s perspective.</p> -<h3 id="so---what-changed">So - What Changed?</h3> -<p>Webfonts</p> -<p>I’m not using any webfonts but instead defaulting to the user’s OS System Fonts. I love custom typefaces but performance takes just too much of a hit on my personal site to bother with them.</p> -<pre><code>body { -font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif,"Sans Serif",Icons; -} -</code></pre> -<p>For reference, there are some things you should to look out for when using custom typefaces:</p> -<ul> -<li>Readability and accessibility</li> -<li>Possible extra overhead loading in a custom @font-face</li> -<li>Try to avoid any FOUT, FOIT, FOFT</li> -<li>Don’t go down the rabbit hole of using 3rd party plugins to optimize something as basic as a typeface</li> -</ul> -<h3 id="critical-css">Critical CSS</h3> -<p>This part was easy. In order to avoid the weird styling ‘pops’ present on some websites when initially loading with slow connections, it’s best to place all your most critical styling inline and then load your external CSS once everything else has loaded.</p> -<p>On top of that, I decided to also implement Filament Group’s loadCSS function to load my CSS asynchronously. If you are not currently using this in any of your projects; stop reading this and go do it! It’s a game changer.</p> -<h3 id="critical-javascript">Critical JavaScript</h3> -<p>My personal site only uses a small amount of JavaScript on the article post Jekyll template pages. By using the defer property I can be sure to load the IntersectionObserver API polyfill after the rest of the DOM as finished loading.</p> -<pre><code><script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=IntersectionObserver" defer> -</code></pre> -<p>I could probably optimize this further by only calling these scripts if an image is actually present in the article post, but this fits my needs nicely as is.</p> -<h3 id="responsive-images">Responsive Images</h3> -<p>The only images I use are those included in supported blog posts, so the first step was making sure to only call iolazy.min.js on those specific template pages. The next step was defaulting to webp image formats with a lossless jpg fall-back with the help of the picture element:</p> -<p>I’ve also included responsive image sizes for further optimization based on screen size and loading speeds.</p> -<pre><code><figure> -<picture - <source type="image/webp" - data-srcset=" - /images/articles/webp/flat-design-toggles_p0v2hv_c_scale,w_200.webp 200w, - /images/articles/webp/flat-design-toggles_p0v2hv_c_scale,w_1400.webp 1400w" - class="lazyload"/> - <img - sizes="(max-width: 1400px) 100vw, 1400px" - data-srcset=" - /images/articles/flat-design-toggles_qfre51_c_scale,w_200.webp 200w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_727.webp 727w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_1065.webp 1065w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_1400.webp 1400w" - src="/images/placeholder.webp" - alt="Toggles Comparison" - class="lazyload"/> -</picture> -</figure> -</code></pre> -<p>What about users with JavaScript disabled I hear you ask? It’s time for noscript to save the day:</p> -<pre><code><noscript> - <picture> - <source type="image/webp" - srcset=" - /images/articles/webp/flat-design-toggles_p0v2hv_c_scale,w_200.webp 200w, - /images/articles/webp/flat-design-toggles_p0v2hv_c_scale,w_1400.webp 1400w"> - <img - sizes="(max-width: 1400px) 100vw, 1400px" - srcset=" - /images/articles/flat-design-toggles_qfre51_c_scale,w_200.webp 200w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_727.webp 727w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_1065.webp 1065w, - /images/articles/flat-design-toggles_qfre51_c_scale,w_1400.webp 1400w" - src="/images/articles/flat-design-toggles_qfre51_c_scale,w_1400.webp" - alt="Toggles Comparison"/> - </picture> -</noscript> -</code></pre> -<h3 id="https-caching">HTTPS & Caching</h3> -<p>The Lighthouse audit also suggested implementing an SSL certificate (something I’ve been meaning to do for a while anyway) and also utilize CDN caching. So it was Cloudflare to the rescue!</p> -<p>Since my website is hosted through Github, setting up a <em>free</em> SSL certificate and enabling site-wide caching was a breeze. If you’re interested in setting this up yourself, step-by-step instructions can be found here.</p> -<p>This simple update helped boost my best practices score from a 69 to a 94. Yet another performance enhancement you should be enabling for all your current and future projects!</p> -<h2 id="performance-happiness">Performance Happiness</h2> -<p>Overall I’m pretty content with the <strong>major</strong> performance boost my site has received from these fairly <em>minor</em> updates and I hope this article inspires other designers and developers to jump into updating their own site/app performance speeds. The pay-off is truly worth it!</p> -<h3 id="some-extra-reading-material">Some Extra Reading Material</h3> -<ul> -<li>Web Performance in Action by Jeremy Wagner</li> -<li>Responsible Responsive Design by Scott Jehl</li> -<li>Designing with Progressive Enhancement: Building the Web that Works for Everyone by Todd Parker, Scott Jehl, Maggie Costello Wachs, Patty Toland</li> -</ul> -<footer role="contentinfo"> - <h2>Menu Navigation</h2> - <ul id="menu"> - <li><a href="/">Home</a></li> - <li><a href="/projects">Projects</a></li> - <li><a href="/uses">Uses</a></li> - <li><a href="/wiki">Wiki</a></li> - <li><a href="/resume">Resume</a></li> - <li><a href="/colophon">Colophon</a></li> - <li><a href="/now">Now</a></li> - <li><a href="/donate">Donate</a></li> - <li><a href="/atom.xml">RSS</a></li> - <li><a href="#top">↑ Top of the page</a></li> - </ul> - <small> - Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br> - Maintained with ♥ for the web. <br> - Proud supporter of <a href="https://usefathom.com/ref/DKHJVX">Fathom</a> & <a href="https://nextdns.io/?from=74d3p3h8">NextDNS</a>. <br> - The content for this site is <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.<br> The <a href="https://git.sr.ht/~bt/bt.ht">code for this site</a> is <a href="https://git.sr.ht/~bt/bt.ht/tree/master/item/LICENSE">MIT</a>. - </small> -</footer>
\ No newline at end of file |