Preventing the Performance Hit from Custom Fonts

Preventing the Performance Hit from Custom Fonts

Only load on large screens

The first idea I saw was Dave Rupert’s tests on only loading @font-face on large screens. Turns out if you use @font-face but don’t ever apply that font-family, the font won’t be downloaded. Pretty smart, browsers. Dave’s demo.

<span class="token atrule"><span class="token rule">@font-face</span></span> <span class="token punctuation">{</span>
  <span class="token property">font-family</span><span class="token punctuation">:</span> <span class="token string">'Dr Sugiyama'</span><span class="token punctuation">;</span>
  <span class="token property">font-style</span><span class="token punctuation">:</span> normal<span class="token punctuation">;</span>
  <span class="token property">font-weight</span><span class="token punctuation">:</span> <span class="token number">400</span><span class="token punctuation">;</span>
  <span class="token property">src</span><span class="token punctuation">:</span> <span class="token function">local</span><span class="token punctuation">(</span><span class="token string">"Dr Sugiyama Regular"</span><span class="token punctuation">)</span>, <span class="token function">local</span><span class="token punctuation">(</span><span class="token string">"DrSugiyama-Regular"</span><span class="token punctuation">)</span>, <span class="token url">url(http://themes.googleusercontent.com/static/fonts/drsugiyama/v2/rq_8251Ifx6dE1Mq7bUM6brIa-7acMAeDBVuclsi6Gc.woff)</span> <span class="token function">format</span><span class="token punctuation">(</span><span class="token string">"woff"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token selector">body </span><span class="token punctuation">{</span>
  <span class="token property">font-family</span><span class="token punctuation">:</span> sans-serif<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token atrule"><span class="token rule">@media</span> <span class="token punctuation">(</span><span class="token property">min-width</span><span class="token punctuation">:</span> 1000px<span class="token punctuation">)</span></span> <span class="token punctuation">{</span>
  <span class="token selector">body </span><span class="token punctuation">{</span>
    <span class="token property">font-family</span><span class="token punctuation">:</span> <span class="token string">'Dr Sugiyama'</span>, sans-serif<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

What is the difference between 301 and 302 redirects in SEO?

Now if you are familiar with SEO and read about it online, you have almost certainly heard the phrase “link juice.”  This is where the redirect status codes come in to play. If you need to suggest to the search engine crawlers that your page, content, URL, or site has moved, then you need to redirect them. The status of that redirect has substantial importance in properly reassigning the “link juice” or ranking value.

What is a 302 redirect?

A 302 status code means Found, or more commonly referred to as “temporarily moved.” This redirect doesn’t carry or pass the link value to the new location. What it does do is get the user to an appropriate location for you so that you aren’t showing them a broken link, a 404 page not found, or an error page.

When should I use a 302 redirect?

You might ask, “If it doesn’t distribute SEO value then why would I use it?” A good example of when to do a 302 redirect would be in an e-commerce setting. Let’s say you have a product that you no longer have for sale– maybe the product is seasonal, out of stock, or is something that you might sell again. In this case, you might want to use a 302 redirect to send the user to the category page.

Postgres TAP: Test Anything Protocol

pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions. The TAP output is suitable for harvesting, analysis, and reporting by a TAP harness, such as those used in Perl applications.

Why would you want to unit test your database? Well, there are a couple of scenarios in which it can be useful.

Death of a Scrum Room

The thing was, ‘The Business’ weren’t sure about agile, and the scrum master had regular fights to run things that way. The problems were textbook:

  • Resistance to addition of work mid-sprint
  • Lack of oversight – is dev X really taking this long to finish story Y? How do we know it’s not already finished, and now they’re just playing Minesweeper?
  • Lack of ‘precise’ answers to questions like “On exactly what date will this massive new piece of work be delivered?”

So a little under a year ago, they parted ways with the scrum master. People began filtering into the room to talk to devs about their work. Devs were called into meetings to discuss when and how they were going to fix issues they were in the middle fixing. Refactoring started to be second-guessed by non-devs, and was eventually banned. Two months went by with enforced overtime.

.. Well-run agile teams can produce great results, but even now – 15 years after the Agile Manifesto – it’s often viewed with suspicion. If you like agile practice you can make efforts to sell it, but people hate change, and you have to know when to move on. Some devs like regimented, waterfall environments, so if those environments and devs find each other, everyone’s happy. You spend too much time at work to stay somewhere if you’re not enjoying it.