aboutsummaryrefslogtreecommitdiff
path: root/build/chasing-performance/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'build/chasing-performance/index.html')
-rw-r--r--build/chasing-performance/index.html47
1 files changed, 2 insertions, 45 deletions
diff --git a/build/chasing-performance/index.html b/build/chasing-performance/index.html
index 86e39cc..fa4a914 100644
--- a/build/chasing-performance/index.html
+++ b/build/chasing-performance/index.html
@@ -3,11 +3,12 @@
<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;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style>
+<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>
@@ -16,82 +17,48 @@
<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&#8217;m keeping this article up as a point of reference.</p>
-
<hr/>
-
<p>So I decided to participate in Smashing Mag&#8217;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 &#38; 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 &#47;&#47; Full source updated stats</p>
-
<h3 id="lighthouse-score---article-page">Lighthouse Score - Article Page</h3>
-
<p>Full source original stats &#47;&#47; Full source updated stats</p>
-
<h3 id="web-page-test---homepage">Web Page Test - Homepage</h3>
-
<p>Full source original stats &#47;&#47; Full source updated stats</p>
-
<h3 id="web-page-test---article-page">Web Page Test - Article Page</h3>
-
<p>Full source original stats &#47;&#47; 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&#8217;s initial load time was slimmed down by a <strong>whopping 4.2 seconds!</strong> That&#8217;s pretty incredible and very noticeable from an end-user&#8217;s perspective.</p>
-
<h3 id="so---what-changed">So - What Changed?</h3>
-
<p>Webfonts</p>
-
<p>I&#8217;m not using any webfonts but instead defaulting to the user&#8217;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&#8217;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 &#8216;pops&#8217; present on some websites when initially loading with slow connections, it&#8217;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&#8217;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&#8217;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>&#60;script src="https:&#47;&#47;cdn.polyfill.io&#47;v2&#47;polyfill.min.js?features=IntersectionObserver" defer&#62;
</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&#8217;ve also included responsive image sizes for further optimization based on screen size and loading speeds.</p>
-
<pre><code>&#60;figure&#62;
&#60;picture
&#60;source type="image&#47;webp"
@@ -112,9 +79,7 @@ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Ca
&#60;&#47;picture&#62;
&#60;&#47;figure&#62;
</code></pre>
-
<p>What about users with JavaScript disabled I hear you ask? It&#8217;s time for noscript to save the day:</p>
-
<pre><code>&#60;noscript&#62;
&#60;picture&#62;
&#60;source type="image&#47;webp"
@@ -133,21 +98,13 @@ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Ca
&#60;&#47;picture&#62;
&#60;&#47;noscript&#62;
</code></pre>
-
<h3 id="https-caching">HTTPS &#38; Caching</h3>
-
<p>The Lighthouse audit also suggested implementing an SSL certificate (something I&#8217;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&#8217;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&#8217;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&#47;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>