A place to cache linked articles (think custom and personal wayback machine)
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang=fr>
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset=utf-8>
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name=viewport content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Smaller, Faster Websites (archive) — David Larlet</title>
  13. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  14. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons/apple-touch-icon.png">
  15. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons/favicon-32x32.png">
  16. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons/favicon-16x16.png">
  17. <link rel="manifest" href="/manifest.json">
  18. <link rel="mask-icon" href="/static/david/icons/safari-pinned-tab.svg" color="#5bbad5">
  19. <link rel="shortcut icon" href="/static/david/icons/favicon.ico">
  20. <meta name="apple-mobile-web-app-title" content="David Larlet">
  21. <meta name="application-name" content="David Larlet">
  22. <meta name="msapplication-TileColor" content="#da532c">
  23. <meta name="msapplication-config" content="/static/david/icons/browserconfig.xml">
  24. <meta name="theme-color" content="#f0f0ea">
  25. <!-- That good ol' feed, subscribe :p. -->
  26. <link rel=alternate type="application/atom+xml" title=Feed href="/david/log/">
  27. <meta name="robots" content="noindex, nofollow">
  28. <meta content="origin-when-cross-origin" name="referrer">
  29. <!-- Canonical URL for SEO purposes -->
  30. <link rel="canonical" href="https://bocoup.com/weblog/smaller-faster-websites">
  31. <style>
  32. /* http://meyerweb.com/eric/tools/css/reset/ */
  33. html, body, div, span,
  34. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  35. a, abbr, address, big, cite, code,
  36. del, dfn, em, img, ins,
  37. small, strike, strong, tt, var,
  38. dl, dt, dd, ol, ul, li,
  39. fieldset, form, label, legend,
  40. table, caption, tbody, tfoot, thead, tr, th, td,
  41. article, aside, canvas, details, embed,
  42. figure, figcaption, footer, header, hgroup,
  43. menu, nav, output, ruby, section, summary,
  44. time, mark, audio, video {
  45. margin: 0;
  46. padding: 0;
  47. border: 0;
  48. font-size: 100%;
  49. font: inherit;
  50. vertical-align: baseline;
  51. }
  52. /* HTML5 display-role reset for older browsers */
  53. article, aside, details, figcaption, figure,
  54. footer, header, hgroup, menu, nav, section { display: block; }
  55. body { line-height: 1; }
  56. blockquote, q { quotes: none; }
  57. blockquote:before, blockquote:after,
  58. q:before, q:after {
  59. content: '';
  60. content: none;
  61. }
  62. table {
  63. border-collapse: collapse;
  64. border-spacing: 0;
  65. }
  66. /* http://practicaltypography.com/equity.html */
  67. /* https://calendar.perfplanet.com/2016/no-font-face-bulletproof-syntax/ */
  68. /* https://www.filamentgroup.com/lab/js-web-fonts.html */
  69. @font-face {
  70. font-family: 'EquityTextB';
  71. src: url('/static/david/css/fonts/Equity-Text-B-Regular-webfont.woff2') format('woff2'),
  72. url('/static/david/css/fonts/Equity-Text-B-Regular-webfont.woff') format('woff');
  73. font-weight: 300;
  74. font-style: normal;
  75. font-display: swap;
  76. }
  77. @font-face {
  78. font-family: 'EquityTextB';
  79. src: url('/static/david/css/fonts/Equity-Text-B-Italic-webfont.woff2') format('woff2'),
  80. url('/static/david/css/fonts/Equity-Text-B-Italic-webfont.woff') format('woff');
  81. font-weight: 300;
  82. font-style: italic;
  83. font-display: swap;
  84. }
  85. @font-face {
  86. font-family: 'EquityTextB';
  87. src: url('/static/david/css/fonts/Equity-Text-B-Bold-webfont.woff2') format('woff2'),
  88. url('/static/david/css/fonts/Equity-Text-B-Bold-webfont.woff') format('woff');
  89. font-weight: 700;
  90. font-style: normal;
  91. font-display: swap;
  92. }
  93. @font-face {
  94. font-family: 'ConcourseT3';
  95. src: url('/static/david/css/fonts/concourse_t3_regular-webfont-20190806.woff2') format('woff2'),
  96. url('/static/david/css/fonts/concourse_t3_regular-webfont-20190806.woff') format('woff');
  97. font-weight: 300;
  98. font-style: normal;
  99. font-display: swap;
  100. }
  101. /* http://practice.typekit.com/lesson/caring-about-opentype-features/ */
  102. body {
  103. /* http://www.cssfontstack.com/ Palatino 99% Win 86% Mac */
  104. font-family: "EquityTextB", Palatino, serif;
  105. background-color: #f0f0ea;
  106. color: #07486c;
  107. font-kerning: normal;
  108. -moz-osx-font-smoothing: grayscale;
  109. -webkit-font-smoothing: subpixel-antialiased;
  110. text-rendering: optimizeLegibility;
  111. font-variant-ligatures: common-ligatures contextual;
  112. font-feature-settings: "kern", "liga", "clig", "calt";
  113. }
  114. pre, code, kbd, samp, var, tt {
  115. font-family: 'TriplicateT4c', monospace;
  116. }
  117. em {
  118. font-style: italic;
  119. color: #323a45;
  120. }
  121. strong {
  122. font-weight: bold;
  123. color: black;
  124. }
  125. nav {
  126. background-color: #323a45;
  127. color: #f0f0ea;
  128. display: flex;
  129. justify-content: space-around;
  130. padding: 1rem .5rem;
  131. }
  132. nav:last-child {
  133. border-bottom: 1vh solid #2d7474;
  134. }
  135. nav a {
  136. color: #f0f0ea;
  137. }
  138. nav abbr {
  139. border-bottom: 1px dotted white;
  140. }
  141. h1 {
  142. border-top: 1vh solid #2d7474;
  143. border-bottom: .2vh dotted #2d7474;
  144. background-color: #e3e1e1;
  145. color: #323a45;
  146. text-align: center;
  147. padding: 5rem 0 4rem 0;
  148. width: 100%;
  149. font-family: 'ConcourseT3';
  150. display: flex;
  151. flex-direction: column;
  152. }
  153. h1.single {
  154. padding-bottom: 10rem;
  155. }
  156. h1 span {
  157. position: absolute;
  158. top: 1vh;
  159. left: 20%;
  160. line-height: 0;
  161. }
  162. h1 span a {
  163. line-height: 1.7;
  164. padding: 1rem 1.2rem .6rem 1.2rem;
  165. border-radius: 0 0 6% 6%;
  166. background: #2d7474;
  167. font-size: 1.3rem;
  168. color: white;
  169. text-decoration: none;
  170. }
  171. h2 {
  172. margin: 4rem 0 1rem;
  173. border-top: .2vh solid #2d7474;
  174. padding-top: 1vh;
  175. }
  176. h3 {
  177. text-align: center;
  178. margin: 3rem 0 .75em;
  179. }
  180. hr {
  181. height: .4rem;
  182. width: .4rem;
  183. border-radius: .4rem;
  184. background: #07486c;
  185. margin: 2.5rem auto;
  186. }
  187. time {
  188. display: bloc;
  189. margin-left: 0 !important;
  190. }
  191. ul, ol {
  192. margin: 2rem;
  193. }
  194. ul {
  195. list-style-type: square;
  196. }
  197. a {
  198. text-decoration-skip-ink: auto;
  199. text-decoration-thickness: 0.05em;
  200. text-underline-offset: 0.09em;
  201. }
  202. article {
  203. max-width: 50rem;
  204. display: flex;
  205. flex-direction: column;
  206. margin: 2rem auto;
  207. }
  208. article.single {
  209. border-top: .2vh dotted #2d7474;
  210. margin: -6rem auto 1rem auto;
  211. background: #f0f0ea;
  212. padding: 2rem;
  213. }
  214. article p:last-child {
  215. margin-bottom: 1rem;
  216. }
  217. p {
  218. padding: 0 .5rem;
  219. margin-left: 3rem;
  220. }
  221. p + p,
  222. figure + p {
  223. margin-top: 2rem;
  224. }
  225. blockquote {
  226. background-color: #e3e1e1;
  227. border-left: .5vw solid #2d7474;
  228. display: flex;
  229. flex-direction: column;
  230. align-items: center;
  231. padding: 1rem;
  232. margin: 1.5rem;
  233. }
  234. blockquote cite {
  235. font-style: italic;
  236. }
  237. blockquote p {
  238. margin-left: 0;
  239. }
  240. figure {
  241. border-top: .2vh solid #2d7474;
  242. background-color: #e3e1e1;
  243. text-align: center;
  244. padding: 1.5rem 0;
  245. margin: 1rem 0 0;
  246. font-size: 1.5rem;
  247. width: 100%;
  248. }
  249. figure img {
  250. max-width: 250px;
  251. max-height: 250px;
  252. border: .5vw solid #323a45;
  253. padding: 1px;
  254. }
  255. figcaption {
  256. padding: 1rem;
  257. line-height: 1.4;
  258. }
  259. aside {
  260. display: flex;
  261. flex-direction: column;
  262. background-color: #e3e1e1;
  263. padding: 1rem 0;
  264. border-bottom: .2vh solid #07486c;
  265. }
  266. aside p {
  267. max-width: 50rem;
  268. margin: 0 auto;
  269. }
  270. /* https://fvsch.com/code/css-locks/ */
  271. p, li, pre, code, kbd, samp, var, tt, time, details, figcaption {
  272. font-size: 1rem;
  273. line-height: calc( 1.5em + 0.2 * 1rem );
  274. }
  275. h1 {
  276. font-size: 1.9rem;
  277. line-height: calc( 1.2em + 0.2 * 1rem );
  278. }
  279. h2 {
  280. font-size: 1.6rem;
  281. line-height: calc( 1.3em + 0.2 * 1rem );
  282. }
  283. h3 {
  284. font-size: 1.35rem;
  285. line-height: calc( 1.4em + 0.2 * 1rem );
  286. }
  287. @media (min-width: 20em) {
  288. /* The (100vw - 20rem) / (50 - 20) part
  289. resolves to 0-1rem, depending on the
  290. viewport width (between 20em and 50em). */
  291. p, li, pre, code, kbd, samp, var, tt, time, details, figcaption {
  292. font-size: calc( 1rem + .6 * (100vw - 20rem) / (50 - 20) );
  293. line-height: calc( 1.5em + 0.2 * (100vw - 50rem) / (20 - 50) );
  294. margin-left: 0;
  295. }
  296. h1 {
  297. font-size: calc( 1.9rem + 1.5 * (100vw - 20rem) / (50 - 20) );
  298. line-height: calc( 1.2em + 0.2 * (100vw - 50rem) / (20 - 50) );
  299. }
  300. h2 {
  301. font-size: calc( 1.5rem + 1.5 * (100vw - 20rem) / (50 - 20) );
  302. line-height: calc( 1.3em + 0.2 * (100vw - 50rem) / (20 - 50) );
  303. }
  304. h3 {
  305. font-size: calc( 1.35rem + 1.5 * (100vw - 20rem) / (50 - 20) );
  306. line-height: calc( 1.4em + 0.2 * (100vw - 50rem) / (20 - 50) );
  307. }
  308. }
  309. @media (min-width: 50em) {
  310. /* The right part of the addition *must* be a
  311. rem value. In this example we *could* change
  312. the whole declaration to font-size:2.5rem,
  313. but if our baseline value was not expressed
  314. in rem we would have to use calc. */
  315. p, li, pre, code, kbd, samp, var, tt, time, details, figcaption {
  316. font-size: calc( 1rem + .6 * 1rem );
  317. line-height: 1.5em;
  318. }
  319. p, li, pre, details {
  320. margin-left: 3rem;
  321. }
  322. h1 {
  323. font-size: calc( 1.9rem + 1.5 * 1rem );
  324. line-height: 1.2em;
  325. }
  326. h2 {
  327. font-size: calc( 1.5rem + 1.5 * 1rem );
  328. line-height: 1.3em;
  329. }
  330. h3 {
  331. font-size: calc( 1.35rem + 1.5 * 1rem );
  332. line-height: 1.4em;
  333. }
  334. figure img {
  335. max-width: 500px;
  336. max-height: 500px;
  337. }
  338. }
  339. figure.unsquared {
  340. margin-bottom: 1.5rem;
  341. }
  342. figure.unsquared img {
  343. height: inherit;
  344. }
  345. @media print {
  346. body { font-size: 100%; }
  347. a:after { content: " (" attr(href) ")"; }
  348. a, a:link, a:visited, a:after {
  349. text-decoration: underline;
  350. text-shadow: none !important;
  351. background-image: none !important;
  352. background: white;
  353. color: black;
  354. }
  355. abbr[title] { border-bottom: 0; }
  356. abbr[title]:after { content: " (" attr(title) ")"; }
  357. img { page-break-inside: avoid; }
  358. @page { margin: 2cm .5cm; }
  359. h1, h2, h3 { page-break-after: avoid; }
  360. p3 { orphans: 3; widows: 3; }
  361. img {
  362. max-width: 250px !important;
  363. max-height: 250px !important;
  364. }
  365. nav, aside { display: none; }
  366. }
  367. ul.with_columns {
  368. column-count: 1;
  369. }
  370. @media (min-width: 20em) {
  371. ul.with_columns {
  372. column-count: 2;
  373. }
  374. }
  375. @media (min-width: 50em) {
  376. ul.with_columns {
  377. column-count: 3;
  378. }
  379. }
  380. ul.with_two_columns {
  381. column-count: 1;
  382. }
  383. @media (min-width: 20em) {
  384. ul.with_two_columns {
  385. column-count: 1;
  386. }
  387. }
  388. @media (min-width: 50em) {
  389. ul.with_two_columns {
  390. column-count: 2;
  391. }
  392. }
  393. .gallery {
  394. display: flex;
  395. flex-wrap: wrap;
  396. justify-content: space-around;
  397. }
  398. .gallery figure img {
  399. margin-left: 1rem;
  400. margin-right: 1rem;
  401. }
  402. .gallery figure figcaption {
  403. font-family: 'ConcourseT3'
  404. }
  405. footer {
  406. font-family: 'ConcourseT3';
  407. display: flex;
  408. flex-direction: column;
  409. border-top: 3px solid white;
  410. padding: 4rem 0;
  411. background-color: #07486c;
  412. color: white;
  413. }
  414. footer > * {
  415. max-width: 50rem;
  416. margin: 0 auto;
  417. }
  418. footer a {
  419. color: #f1c40f;
  420. }
  421. footer .avatar {
  422. width: 200px;
  423. height: 200px;
  424. border-radius: 50%;
  425. float: left;
  426. -webkit-shape-outside: circle();
  427. shape-outside: circle();
  428. margin-right: 2rem;
  429. padding: 2px 5px 5px 2px;
  430. background: white;
  431. border-left: 1px solid #f1c40f;
  432. border-top: 1px solid #f1c40f;
  433. border-right: 5px solid #f1c40f;
  434. border-bottom: 5px solid #f1c40f;
  435. }
  436. </style>
  437. <h1>
  438. <span><a id="jumper" href="#jumpto" title="Un peu perdu ?">?</a></span>
  439. Smaller, Faster Websites (archive)
  440. <time>Pour la pérennité des contenus liés. Non-indexé, retrait sur simple email.</time>
  441. </h1>
  442. <section>
  443. <article>
  444. <h3><a href="https://bocoup.com/weblog/smaller-faster-websites">Source originale du contenu</a></h3>
  445. <p><img src="https://static2.bocoup.com/assets/2015/11/05183156/title.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183156/title-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183156/title-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183156/title-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183156/title-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183156/title-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183156/title.jpg 1200w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  446. <p>My name is Mat Marquis, of Marquis Home Renovation. I don’t care about websites. I’m a carpenter.</p>
  447. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/stationwagon.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/stationwagon-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/stationwagon-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/stationwagon-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/stationwagon-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/stationwagon-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/stationwagon.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  448. <p>That, you’ll notice, is why my slide deck looks like the side of the most badass station wagon you’ve ever seen.</p>
  449. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/bench.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/bench-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/bench-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/bench-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/bench-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/bench-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/bench.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  450. <p>As for where I work, it’s here. This is my actual workbench; it’s older than I am. Those are my tools; they’re also older than I am. That pile of oak and mahogany on the right is the start of my new coffee table.</p>
  451. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/bocoup.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/bocoup-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/bocoup-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/bocoup-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/bocoup-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/bocoup-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/bocoup.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  452. <p>As for making websites or whatever, I work at Bocoup—formerly, <a href="https://filamentgroup.com">Filament Group</a>. I’m an editor of the <a href="http://www.w3.org/TR/2015/WD-html51-20151007/">W3C HTML5 specification</a>. I make websites.</p>
  453. <p>But I’m not here to talk about me. You’re not here for me. You’re here with purpose; you’re here to <em>learn</em>, and I am here to teach you…</p>
  454. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/table.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/table-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/table-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/table-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/table-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/table-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/table.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  455. <p>…about furniture. This is a Queen Anne tea table, thought to be made in either New England or Ireland circa 1750. It came right at the advent of the Federal style that was gaining popularity on the tail of Thomas Chippendale’s much more ornate work—though you <em>could</em> argue that his wide use of mahogany is what <em>led</em> to the Federal style, where woodworkers began to favor simpler designs that better highlighted unique grain patterns!</p>
  456. <p>I’ll pause for a second so you can all get some notes down, here. … No?</p>
  457. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/coffee.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/coffee-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/coffee-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/coffee-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/coffee-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/coffee-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/coffee.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  458. <p>No, okay—you don’t care. It’s a table. It keeps your coffee off the floor. What this table is—for almost everyone here, I’d bet—is its <em>purpose</em>.</p>
  459. <p>Likewise, you’re here to learn about websites; who cares about me, or about tables? Up here, I’m kinda reduced to my purpose. I’m just a vehicle for transferring information.</p>
  460. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/website.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/website-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/website-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/website-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/website-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/website-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/website.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  461. <p>So, let’s talk about websites—but not the way I’d talk about furniture, if you gave me half a chance. This is about the user that just wants to keep their coffee off the floor. They don’t care about <strong>the website</strong>. They don’t care about frameworks; they don’t care about browsers. They want their information and they want to get out. A website, to them, is its purpose.</p>
  462. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/4th-wall.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/4th-wall-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/4th-wall-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/4th-wall-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/4th-wall-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/4th-wall-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/4th-wall.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  463. <p>When we present users with a slow website, a loading spinner, laggy webfonts—or tell them outright that they‘re not using a website the right way—we’re breaking the fourth wall. We’ve gone so far as to invent an arbitary line between “webapp” and “website” so we could justify these decisions to ourselves: “well, but, this is a web <em>app</em>. It… it has… JSON. The people that can’t use the thing I built? They don’t get a say.”</p>
  464. <p>We, as an industry, have nearly decided that we’re doing a great job as long as we don’t count the cases where we’re doing a terrible job. We want the user to think about The Website—to sympathize with <em>us</em>—over their reason for being there. We’re making them sit through a lecture about furniture design every time they try to sit down in a chair.</p>
  465. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/ikea.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/ikea-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/ikea-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/ikea-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/ikea-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/ikea-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/ikea.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  466. <p>When we prize our own convenience over craft, we’re building a web for us, the developers. We’re building a web that’s easy to assemble but lousy to use.</p>
  467. <p>That’s not what the web is to me, though—that’s not what this <em>job</em> is, to me. The meaning I take from this gig doesn’t come from getting a div to show up in the right place. It comes from knowing that working just a little harder can mean that entire populations just setting foot on the web for the first time will be able to tap into the collected knowledge of the whole of mankind.</p>
  468. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/lab.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/lab-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/lab-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/lab-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/lab-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/lab-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/lab.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  469. <p>We can make this a job where we make something only work as much as it has to in the handful of easy browsers someone put on a list on our desk, or we can make it about working harder than that.</p>
  470. <p>We can make up our minds that we want everything we do to nudge the entire web toward something better, faster, more inclusive. We can build for the web’s purpose: connecting people all over the world. And when we put in that work, we get better at it; we get faster at it. We start doing things the right way by default. We get better. We make that the job.</p>
  471. <p>So, we’re not gonna talk about you and me, and we’re not gonna talk about furniture. Let’s talk about how real people around the world use the web.</p>
  472. <p>
  473. <figure data-toggle="table">
  474. <img src="https://static2.bocoup.com/assets/2015/11/05183211/device-use.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/device-use-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/device-use-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/device-use-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/device-use-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/device-use-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/device-use.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  475. <figcaption><a href="http://gs.statcounter.com/#all-comparison-ww-monthly-201408-201408-bar">http://gs.statcounter.com/#all-comparison-ww-monthly-201408-201408-bar</a><br />
  476. <table>
  477. <thead>
  478. <tr>
  479. <th scope="col">Desktop Traffic</th>
  480. <th scope="col">Mobile and Tablet Traffic</th>
  481. </tr>
  482. <tbody>
  483. <tr>
  484. <td>64.58%</td>
  485. <td>35.3%</td>
  486. </tr>
  487. </tbody>
  488. </table>
  489. </figcaption>
  490. <p></figure>
  491. <p>Mobile and tablets account for 35.3% of all internet traffic worldwide, and that figure is steadily increasing. In many parts of the world, “desktop” traffic is practically nonexistent. Building massive, resource-heavy sites means excluding millions of users that have only ever known the web by way of feature phones or slightly better—users paying for every kilobyte they consume; users that already have to keep tabs on which sites they need to avoid day-to-day because of the cost of visiting them. I don’t mean some nebulous hand-wavy “bandwidth cost,” either—I mean actual economic cost.</p>
  492. <p>
  493. <figure>
  494. <img src="https://static2.bocoup.com/assets/2015/11/05183211/network-use.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/network-use-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/network-use-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/network-use-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/network-use-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/network-use-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/network-use.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  495. <figcaption>
  496. <a href="http://gs.statcounter.com/#all-comparison-ww-monthly-201408-201408-bar">http://gs.statcounter.com/#all-comparison-ww-monthly-201408-201408-bar</a><br />
  497. </figcaption>
  498. </figure>
  499. <p>When you take us out of the equation, the world overwhelmingly views the web via EDGE connection. And even here at home, the prevalent mobile connection is 3G at best.</p>
  500. <p>
  501. <figure>
  502. <img src="https://static2.bocoup.com/assets/2015/11/05183211/subscriptions-edge.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/subscriptions-edge-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/subscriptions-edge-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/subscriptions-edge-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/subscriptions-edge-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/subscriptions-edge-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/subscriptions-edge.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  503. <figcaption>
  504. <a href="ericsson.com/res/docs/2014/ericsson-mobility-report-november-2014.pdf">ericsson.com/res/docs/2014/ericsson-mobility-report-november-2014.pdf</a><br />
  505. </figcaption>
  506. </figure>
  507. <p>In just the third quarter of 2014, there were one hundred and ten million new mobile subscriptions worldwide. 102 million of these were in areas where the prevalent network is EDGE.</p>
  508. <p>But let’s be honest: these figures are easy to wave off by saying “well, those aren’t our target markets. Here at home, this isn’t really a problem.”</p>
  509. <p>
  510. <figure>
  511. <img src="https://static2.bocoup.com/assets/2015/11/05183211/smartphones-only.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/smartphones-only-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/smartphones-only-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/smartphones-only-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/smartphones-only-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/smartphones-only-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/smartphones-only.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  512. <figcaption>
  513. <a href="http://www.pewinternet.org/2015/04/01/us-smartphone-use-in-2015/#smartphones">http://www.pewinternet.org/2015/04/01/us-smartphone-use-in-2015/#smartphones</a><br />
  514. </figcaption>
  515. </figure>
  516. <p>Well, as it stands right now, some twenty percent of US users use their smartphones almost exclusively for internet access—they either have no broadband service, or very limited access to the internet otherwise.</p>
  517. <p>7% of those users have absolutely no access to the internet outside of their smartphones, and that’s the direction things are trending.</p>
  518. <p>
  519. <figure>
  520. <img src="https://static2.bocoup.com/assets/2015/11/05183211/max-data.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/max-data-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/max-data-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/max-data-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/max-data-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/max-data-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/max-data.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  521. <figcaption>
  522. <a href="http://www.pewinternet.org/2015/04/01/us-smartphone-use-in-2015/#smartphones">http://www.pewinternet.org/2015/04/01/us-smartphone-use-in-2015/#smartphones</a><br />
  523. </figcaption>
  524. </figure>
  525. <p>Meanwhile, almost a third of those smartphone-dependent users in the US frequently run up against their monthly data allowance.</p>
  526. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/smaller-websites.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/smaller-websites-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/smaller-websites-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/smaller-websites-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/smaller-websites-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/smaller-websites-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/smaller-websites.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  527. <p>Huge, slow websites mean not only letting our target audience down, but making it impossible to expand our reach beyond that audience.</p>
  528. <p>
  529. <figure data-toggle="table">
  530. <img src="https://static2.bocoup.com/assets/2015/11/05183211/average-size.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/average-size-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/average-size-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/average-size-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/average-size-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/average-size-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/average-size.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  531. <figcaption><a href="http://httparchive.org/interesting.php?a=All&l=Apr%2015%202015">http://httparchive.org/interesting.php?a=All&#038;l=Apr%2015%202015</a></p>
  532. <table>
  533. <thead>
  534. <tr>
  535. <th scope="col">CSS</th>
  536. <th scope="col">JavaScript</th>
  537. <th scope="col">HTML</th>
  538. <th scope="col">Fonts</th>
  539. <th scope="col">Other</th>
  540. <th scope="col">Images</th>
  541. </tr>
  542. </thead>
  543. <tbody>
  544. <tr>
  545. <td>61KB</td>
  546. <td>318KB</td>
  547. <td>61KB</td>
  548. <td>93KB</td>
  549. <td>152KB</td>
  550. <td>1297KB</td>
  551. </tr>
  552. </tbody>
  553. </table>
  554. </figcaption>
  555. </figure>
  556. <p>The average webpage’s total transfer size is ridiculous. As of a few months ago, we broke the two megabyte mark—and images alone account for more than sixty percent of that.</p>
  557. <p>
  558. <figure data-toggle="table">
  559. <img src="https://static2.bocoup.com/assets/2015/11/05183211/asset-size.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/asset-size-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/asset-size-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/asset-size-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/asset-size-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/asset-size-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/asset-size.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  560. <figcaption><a href="http://httparchive.org/interesting.php?a=All&l=Apr%2015%202015">http://httparchive.org/interesting.php?a=All&#038;l=Apr%2015%202015</a><br />
  561. <table>
  562. <tr>
  563. <th scope="col">Date</th>
  564. <th scope="col">CSS</th>
  565. <th scope="col">JavaScript</th>
  566. <th scope="col">Images</th>
  567. </tr>
  568. <tr>
  569. <th scope="row">April 15, 2013</td>
  570. <td>36KB</td>
  571. <td>221KB</td>
  572. <td>856KB</td>
  573. </tr>
  574. <tr>
  575. <th scope="row">January 1, 2014</td>
  576. <td>46KB</td>
  577. <td>272KB</td>
  578. <td>1028KB</td>
  579. </tr>
  580. <tr>
  581. <th scope="row">April 15, 2014</td>
  582. <td>50KB</td>
  583. <td>282KB</td>
  584. <td>1104KB</td>
  585. </tr>
  586. <tr>
  587. <th scope="row">January 1, 2015</td>
  588. <td>58KB</td>
  589. <td>295KB</td>
  590. <td>1248KB</td>
  591. </tr>
  592. <tr>
  593. <th scope="row">April 15, 2015</td>
  594. <td>61KB</td>
  595. <td>318KB</td>
  596. <td>1297KB</td>
  597. </tr>
  598. </table>
  599. </figcaption>
  600. </figure>
  601. <p>Now, over the past few years, the average weight of our CSS has barely budged—adding a couple of media queries isn’t to blame for this new page weight.</p>
  602. <p>Our JavaScript has crept up a bit, but given the incredibly rich interactions we’ve seen on the web in recent years, a few kilobytes seems pretty reasonable.</p>
  603. <p>Images, though—those are doing real damage, and for a while things were looking grim. I’ve cited these figures before, in talks; this same chart, in fact, updated from month to month. The reason I’m showing it again here, today, is that something has changed. The average webpage’s image weight is still increasing, but it’s just starting to slow down.</p>
  604. <p>
  605. <figure data-toggle="figcaption">
  606. <img src="https://static2.bocoup.com/assets/2015/11/05183211/etsy.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/etsy-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/etsy-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/etsy-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/etsy-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/etsy-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/etsy.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  607. <figcaption>
  608. <blockquote>
  609. Etsy saw an increased bounce rate of 12% on mobile if we added 160k of images to a page.<br />
  610. <cite><a href="https://twitter.com/lara_hogan/status/444250723614605312">Lara Hogan</a></cite>
  611. </p></blockquote>
  612. </figcaption>
  613. </figure>
  614. <p>It’s a good thing, too. No matter how nice they are, putting a huge, bandwidth-obliterating wall of images between your users and the thing they came to your site to do will absolutely drive them away. 160 kilobytes is almost nothing to us, but enough to increase Etsy’s bounce rates by more than ten percent.</p>
  615. <p>
  616. <figure data-toggle="figcaption">
  617. <img src="https://static2.bocoup.com/assets/2015/11/05183211/respimg-stat.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/respimg-stat-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-stat-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-stat-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/respimg-stat-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-stat-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-stat.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  618. <figcaption>
  619. <blockquote><p>
  620. It is extremely rare where one optimization lets us knock off such a significant amount of page weight, but here we are staring one such technique right in the face. 72% less image weight.<br />
  621. <a href="https://twitter.com/tkadlec">Tim Kadlec</a>, <cite><a href="http://timkadlec.com/2013/06/why-we-need-responsive-images/">Why We Need Responsive Images</a></cite>
  622. </p></blockquote>
  623. </figcaption>
  624. </figure>
  625. <p>Now, I don’t know this for a fact, but I sincerely hope that the slowing trend toward higher image weights comes from all the new, smarter image delivery options that fall under the “responsive images” umbrella.</p>
  626. <p>
  627. <figure>
  628. <img src="https://static2.bocoup.com/assets/2015/11/05183211/respimg-ala.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/respimg-ala-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-ala-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-ala-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/respimg-ala-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-ala-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-ala.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  629. <figcaption><a href="http://alistapart.com/article/responsive-images-how-they-almost-worked-and-what-we-need">Responsive Images: How they Almost Worked and What We Need</a></figcaption>
  630. </figure>
  631. <p>For a lot of you, native responsive images won’t be huge news. Some of you might have heard whispers about a potential solution coming along—or a fight between the WHATWG’s <code>srcset</code> and the <code>picture</code> element put forth by a scrappy band of web standards rebels and their handsome, charismatic leader. <em>Cough.</em></p>
  632. <p>
  633. <figure>
  634. <img src="https://static2.bocoup.com/assets/2015/11/05183211/respimg-spec.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/respimg-spec-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-spec-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-spec-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/respimg-spec-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/respimg-spec-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/respimg-spec.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  635. <figcaption><a href="http://html.spec.whatwg.org/multipage/embedded-content.html">The HTML Specification</a></figcaption>
  636. </figure>
  637. <p>All that dust has settled, and we got much more out of it than one new element; we got an entire suite of enhancements to the <code>img</code> element to go with it. Native options for dealing with Retina, with the size of an image in a layout, even dealing with alternate image formats—something we’ve never been able to do natively, prior to this year.</p>
  638. <p>
  639. <figure>
  640. <img src="https://static2.bocoup.com/assets/2015/11/05183211/hbr-size.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/hbr-size-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-size-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-size-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/hbr-size-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-size-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-size.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  641. <figcaption><a href="https://hbr.org">https://hbr.org</a></figcaption>
  642. </figure>
  643. <p>We’re implementing some of these new markup patterns on my current project: the Harvard Business Review website. Unfortunately, their responsive redesign last November didn’t do anything to tailor assets to varying user contexts. Regardless of your viewport size or resolution, an article page always came with all the same assets. A full two megabytes of this page are in images.</p>
  644. <p>
  645. <figure>
  646. <img src="https://static2.bocoup.com/assets/2015/11/05183211/same-data.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/same-data-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/same-data-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/same-data-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/same-data-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/same-data-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/same-data.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  647. <figcaption><a href="http://www.guypo.com/real-world-rwd-performance-take-2/">Real World RWD Performance &#8211; Take 2</a></figcaption>
  648. </figure>
  649. <p>And I don’t mean that to sound like a knock on HBR; they did a great job on this redesign, and they’re not alone in these issues: 72% of responsive sites are sending roughly the same data to users regardless of their context. Only about six percent of responsive sites are taking <em>significant</em> steps to tailor assets to mobile devices.</p>
  650. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/dpr.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/dpr-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/dpr-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/dpr-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/dpr.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  651. <p>Any work we do with responsive images is more or less gonna break down to some combination of these four use cases. The “device pixel ratio” use case deals only with the pixel density of a user’s display.</p>
  652. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/dpr-illus.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/dpr-illus-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-illus-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/dpr-illus-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/dpr-illus-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-illus-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/dpr-illus.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  653. <p>These aren’t images that are gonna change in size across our breakpoints, or at least they won’t change much.</p>
  654. <p>We just want high resolution versions for high resolution screens, and low resolution versions for low resolution screens.</p>
  655. <p>
  656. <figure data-toggle="figcaption">
  657. <img src="https://static2.bocoup.com/assets/2015/11/05183211/dpr-syntax.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/dpr-syntax-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-syntax-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/dpr-syntax-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/dpr-syntax-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/dpr-syntax-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/dpr-syntax.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  658. <figcaption>
  659. <pre><code>&lt;img src="standard.jpg" srcset="high-def.jpg 2x" alt="…"&gt;</code></pre>
  660. </figcaption>
  661. </figure>
  662. <p>This syntax is pretty cut-and-dry. We use the <code>img</code> element we’ve come to know and love, complete with an old-fashioned <code>src</code> attribute pointing to the standard definition version of an image.</p>
  663. <p>The new <code>srcset</code> attribute then contains the path to the larger source, and <code>2x</code>—signaling to the browser that this source should be used on displays with twice the pixel density.</p>
  664. <p>
  665. <figure data-toggle="figcaption">
  666. <img src="https://static2.bocoup.com/assets/2015/11/05183211/srcset-suggestion.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/srcset-suggestion-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-suggestion-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-suggestion-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/srcset-suggestion-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-suggestion-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-suggestion.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  667. <figcaption>
  668. <blockquote>Think of <code>srcset</code> as suggestions or just extra information to help a browser decide. Ultimately it can do what it thinks is right.<br />
  669. <a href="https://twitter.com/csstricks">Chris Coyier</a>, <cite><a href="https://css-tricks.com/responsive-images-youre-just-changing-resolutions-use-srcset/">Responsive Images: If You’re Just Changing Resolutions, Use <code>srcset</code></a></cite></p></blockquote>
  670. </figcaption>
  671. </figure>
  672. <p>From a syntax standpoint: saying “do X on a high resolution display” is easy, but knowing when a user <em>wants</em> high resolution images is impossible.</p>
  673. <p>If I’m on a Retina MacBook but tethered to a 3G connection, I probably don’t want massive high-resolution images. So, unlike media queries: <code>srcset</code> is specced as a set of <em>suggestions</em>, telling the browser “here are the sources most appropriate for your display, take them or leave them.” By acting as a suggestion, <code>srcset</code> would allow browsers to introduce user settings like “always give me low-res images” or “give me high-res images as bandwidth permits.”</p>
  674. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/types.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/types-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/types-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/types-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/types-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/types-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/types.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  675. <p>The “types” use case isn’t concerned with viewport size or resolution—it’s concerned with the image formats supported by the user’s browser. It allows us to use the single-request fallback pattern already built into <code>picture</code> so we can serve alternate image <em>formats</em> in smarter ways.</p>
  676. <p>
  677. <figure data-toggle="figcaption">
  678. <img src="https://static2.bocoup.com/assets/2015/11/05183211/webp.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/webp-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/webp-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/webp-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/webp-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/webp-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/webp.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  679. <figcaption>
  680. <blockquote>We observed that the average WebP file size is 25%-34% smaller compared to JPEG file size.<cite><a href="https://developers.google.com/speed/webp/docs/webp_study">Google’s WebP Compression Study</a></cite></p></blockquote>
  681. </figcaption>
  682. </figure>
  683. <p>Newer image formats like WebP and SVG come with tremendous potential for savings, but they also come with a major catch: a new image format can’t come with a built-in fallback pattern.</p>
  684. <p>
  685. <figure data-toggle="figcaption">
  686. <img src="https://static2.bocoup.com/assets/2015/11/05183211/old-types.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/old-types-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/old-types-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/old-types-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/old-types-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/old-types-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/old-types.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  687. <figcaption>
  688. <pre><code>&lt;img src="image.webp"
  689. data-fallback="image.jpg"
  690. onerror="this.src=this.getAttribute('data-fallback'); this.onerror=null;"
  691. alt="…"&gt;</code></pre>
  692. </figcaption>
  693. </figure>
  694. <p>The best solutions we had for this all involved the browsing making a request for the file before determining whether we need to throw it away. That means an optimization in browsers that do have native support for the new format, but more overhead for browsers that don’t.</p>
  695. <p>
  696. <figure data-toggle="figcaption">
  697. <img src="https://static2.bocoup.com/assets/2015/11/05183211/new-types.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/new-types-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/new-types-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/new-types-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/new-types-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/new-types-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/new-types.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  698. <figcaption>
  699. <pre><code>&lt;picture&gt;
  700. &lt;source srcset="image.webp" type="image/webp"&gt;
  701. &lt;img src="image.jpg" alt="…"&gt;
  702. &lt;/picture&gt;</code></pre>
  703. </figcaption>
  704. </figure>
  705. <p>But the <code>picture</code> element was introduced for the sake of applying custom logic to image requests before they even go out—and the fallback pattern is baked in.</p>
  706. <p>If the <code>picture</code> element is supported, we can use a <code>type</code> attribute on a <code>source</code> element to tell the browser “only load this source if you support this MIME type, and if not, continue on to load the fallback image.”</p>
  707. <p>In the event that the new markup <em>isn’t</em> recognized, it all gets thrown away except for the one part the browser will recognize: the fallback <code>img</code> element inside <code>picture</code>.</p>
  708. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/sizes.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/sizes-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/sizes-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/sizes-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/sizes-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/sizes-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/sizes.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  709. <p>The <code>sizes</code> attribute is a big deal. It’s the culmination of three years of responsive images discussion, by which I absolutely mean “mailing list arguments.” We all wanted a way to provide a set of image sources that are selected only when they’re appropriate for the size of the image in the layout <em>and</em> all of the user’s browsing conditions—device pixel ratio, bandwidth, all of it. That’s a tall order from a spec standpoint, but couldn’t be simpler from a developer standpoint: we wanna have our CMS generate a couple of different cuts of an image and some markup to match, and we don’t want to think about responsive images much further than that.</p>
  710. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/hbr-sizes-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-sizes-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/hbr-sizes-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-sizes.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  711. <p>We’ll use this markup in any situation where don’t need explicit control over image sources—so, all the sources are identical except for their sizes.</p>
  712. <p>The lede image on HBR article pages is a good example of this. We’re not doing anything to change the cropping or zooming of the image across our breakpoints—we’re just scaling a large image to fit the layout. So, plain ol’ <code>max-width: 100%</code>.</p>
  713. <p>
  714. <figure data-toggle="figcaption">
  715. <img src="https://static2.bocoup.com/assets/2015/11/05183211/srcset-sizes.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/srcset-sizes-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-sizes-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-sizes-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/srcset-sizes-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-sizes-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-sizes.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  716. <figcaption>
  717. <pre><code>&lt;img
  718. sizes="100vw" srcset="small.jpg 400w, med.jpg 800w, big.jpg 1600w"
  719. src="small.jpg" alt="…"&gt;</code></pre>
  720. </figcaption>
  721. </figure>
  722. <p>The <code>sizes</code> syntax—in concert with <code>srcset</code>—allows us to provide the browser with a couple of sources and some information about them, then let it completely take the wheel. The viewport size and pixel density—all the information the browser has at hand is factored in, and the best applicable source is chosen automatically. This also means there’s room for the browser to get creative—Firefox and Chrome’s implementations will never load a smaller size than they already have cached. What would be the point in loading another source, when the user already has an identical image that works for those viewport sizes?</p>
  723. <p>It’s a little tricky to understand at a glance, though. Unlike the <code>1x</code>/<code>2x</code> syntax we were using with <code>srcset</code> earlier, we’re not using it to tell the browser what to do with our sources. Instead, we’re just giving it a list of the sources and their inherent sizes. The <code>sizes</code> attribute then tells the browser how those sources are meant to be displayed, relative to the viewport—<code>100vw</code> here, for example, means that this image will occupy one hundred percent of the viewport.</p>
  724. <p>
  725. <figure data-toggle="figcaption">
  726. <img src="https://static2.bocoup.com/assets/2015/11/05183211/srcset-w-math.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/srcset-w-math-383x216.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-w-math-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-w-math-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/srcset-w-math-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-w-math-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-w-math.jpg 2552w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  727. <figcaption>
  728. <pre><code>&lt;img
  729. sizes="100vw" srcset="small.jpg <span aria-labelledby="four">400w</span>, med.jpg <span aria-labelledby="four">800w</span>, big.jpg <span aria-labelledby="four">1600w</span>"
  730. src="small.jpg" alt="…"&gt;</code></pre>
  731. <div role="math" id="four" aria-label="Four hundred divided by three hundred and twenty equals one point two five">
  732. <math xmlns="http://www.w3.org/1998/Math/MathML"><mn>400</mn><mo>/</mo><mn>320</mn><mo>=</mo><mn>1.25</mn></math>
  733. </div>
  734. <div role="math" id="eight" aria-label="Eight hundred divided by three hundred and twenty equals two point five">
  735. <math xmlns="http://www.w3.org/1998/Math/MathML"><mn>800</mn><mo>/</mo><mn>320</mn><mo>=</mo><mn>2.5</mn></math>
  736. </div>
  737. <div role="math" id="sixteen" aria-label="Sixteen hundred divided by three hundred and twenty equals five">
  738. <math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1600</mn><mo>/</mo><mn>320</mn><mo>=</mo><mn>5</mn></math>
  739. </div>
  740. </figcaption>
  741. </figure>
  742. <p>When the browser encounters this markup, it does a little familiar responsive web design math: target divided by context, just like when we’re putting our layouts together.</p>
  743. <p>Let’s say we’re looking at this markup on an iPhone, with a 320 pixel wide viewport. Our smallest image has an inherent size of 400 pixels, so 400/320 is 1.25. The next image up is 800 pixels wide, and we do the same thing—and so on.</p>
  744. <p>The math we’re doing here is what the browser does when it encounters this markup: it takes that <code>sizes</code> value, relative to the viewport, and divides all the image source sizes against it.</p>
  745. <figure data-toggle="figcaption">
  746. <img src="https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/srcset-calc-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-calc-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/srcset-calc-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-calc.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  747. <figcaption>
  748. <pre><code>&lt;img
  749. srcset="small.jpg 1.25x, med.jpg 2.5x, big.jpg 5x"
  750. src="small.jpg" alt="…"&gt;</code></pre>
  751. </figcaption>
  752. </figure>
  753. <p>These calculated values then work the same way as the 1x and 2x syntax that we’d write out by hand, but <em>specific to the user’s viewport size</em>. If we were on a Retina iPhone with a 320 pixel viewport, the browser would choose the source that calculates to 2.5x—the closest match to 2x. If we were on a non-Retina iPhone, the browser would serve us the smallest image.</p>
  754. <p>
  755. <figure data-toggle="figcaption">
  756. <img src="https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc-640.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/srcset-calc-640-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc-640-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-calc-640-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/srcset-calc-640-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/srcset-calc-640-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/srcset-calc-640.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  757. <figcaption>
  758. <pre><code>&lt;img
  759. srcset="small.jpg 1.25x, med.jpg 2.5x, big.jpg 5x"
  760. src="small.jpg" alt="…"&gt;</code></pre>
  761. </figcaption>
  762. </figure>
  763. <p>If we were to view that syntax on a 640px display, the results of all that math would end up completely different.</p>
  764. <p>Now the smallest version would never match, since it’s too small for a 640 pixel wide viewport. The medium source would match on low-resolution devices, and the biggest source would match on high-resolution devices. And because we’re using <code>srcset</code>, these are all <em>suggestions</em> to the browser—once there’s an option for the user to override these suggestions through a preference or a bandwidth limit, that gets factored in as well.</p>
  765. <p>
  766. <figure data-toggle="figcaption">
  767. <img src="https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes-value.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/hbr-sizes-value-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes-value-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-sizes-value-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/hbr-sizes-value-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/hbr-sizes-value-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/hbr-sizes-value.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  768. <figcaption>
  769. <pre><code>&lt;img
  770. sizes="(min-width: 48em) 55vw, 97vw"
  771. srcset="small.jpg 400w,
  772. medium.jpg 850w,
  773. large.jpg 1200w"
  774. src="small.jpg"
  775. alt="…"&gt;</code></pre>
  776. </figcaption>
  777. </figure>
  778. <p>A <code>sizes</code> attribute with <code>100vw</code> doesn’t make sense on the HBR site, though. These images are never one hundred percent of the viewport—in fact, the size it occupies in the viewport changes once.</p>
  779. <p>Luckily, <code>sizes</code> allows us to specify all the information about the image’s breakpoints that we could possibly need—using good old-fashioned media queries. This is some unruly-looking markup, I know, but the effect it has is amazing.</p>
  780. <p>
  781. <figure>
  782. <img src="https://static2.bocoup.com/assets/2015/11/05183211/eportis.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/eportis-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/eportis-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/eportis-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/eportis-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/eportis-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/eportis.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  783. <figcaption><a href="http://ericportis.com/posts/2014/srcset-sizes/">http://ericportis.com/posts/2014/srcset-sizes/</a></figcaption>
  784. </figure>
  785. <p>It’s a lot to make sense of all at once—I had to try it out for myself a few times before I got the hang of it, and I helped write the spec. Once it clicks, though, you realize that it allows you to generate a couple of image sources, give the browser a little bit of information, and walk away—you don’t need to know how the browser makes its decisions. In fact, we <em>can’t</em> know. And that’s okay; in fact, that’s a <em>feature</em>.</p>
  786. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/art-direction.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/art-direction-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/art-direction-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/art-direction-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/art-direction-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/art-direction-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/art-direction.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  787. <p>Since the very first incarnation of the <code>picture</code> element—some three years ago, now—we’ve been looking to solve the “art direction” use case. It isn’t anywhere near as common as device pixel ratio or sizes; in fact, we’re not using it on HBR at all.</p>
  788. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/wwf.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/wwf-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/wwf-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/wwf-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/wwf-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/wwf-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/wwf.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  789. <p>Art direction comes into play whenever you want to specify an alternate version of an image for different viewports—different cropping and zooming to best represent the subject of an image in different layouts. We could do this with CSS, but it wouldn’t allow us the finely grained control we might need depending on the subject of the image—we might not always want to zoom in on the center of the image, or know how much we can safely crop off the sides.</p>
  790. <p>
  791. <figure data-toggle="figcaption">
  792. <img src="https://static2.bocoup.com/assets/2015/11/05183211/picture.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/picture-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/picture-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/picture-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/picture-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/picture-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/picture.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  793. <figcaption>
  794. <pre><code>&lt;picture&gt;
  795. &lt;source media="(min-width: 60em)" srcset="large.jpg"&gt;
  796. &lt;source media="(min-width: 40em)" srcset="medium.jpg"&gt;
  797. &lt;img src="small.jpg" alt="…"&gt;
  798. &lt;/picture&gt;</code></pre>
  799. </figcaption>
  800. </figure>
  801. <p>This markup will look real familiar to anyone that followed the entire responsive images saga: it’s the same markup Bruce Lawson originally proposed when we first started thinking these problems through. Multiple <code>source</code> elements inside of a <code>picture</code> element wrapper—just like the <code>video</code> element—with a <code>media</code> attribute telling the browser when they should be applied.</p>
  802. <p>
  803. <figure data-toggle="figcaption">
  804. <img src="https://static2.bocoup.com/assets/2015/11/05183211/picture-min.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/picture-min-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/picture-min-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/picture-min-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/picture-min-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/picture-min-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/picture-min.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  805. <figcaption>
  806. <pre><code>&lt;picture&gt;
  807. &lt;source media="(min-width: 800px)" srcset="pic-big.jpg"&gt;
  808. <strong>&lt;source media="(min-width: 400px)" srcset="pic-med.jpg"&gt;</strong>
  809. &lt;img src="small.jpg" alt="…"&gt;
  810. &lt;/picture&gt;</code></pre>
  811. <p>On a device with 600px-wide display, the medium source is selected.</p>
  812. </figcaption>
  813. </figure>
  814. <p>The first source with a <code>media</code> attribute that matches the viewport size will be selected. If we’re using <code>min-width</code> media queries, we want to have our largest sources first.</p>
  815. <p>
  816. <figure data-toggle="figcaption">
  817. <img src="https://static2.bocoup.com/assets/2015/11/05183211/picture-fallbk.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/picture-fallbk-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/picture-fallbk-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/picture-fallbk-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/picture-fallbk-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/picture-fallbk-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/picture-fallbk.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  818. <figcaption>
  819. <pre><code>&lt;picture&gt;
  820. &lt;source media="(min-width: 800px)" srcset="pic-big.jpg"&gt;
  821. &lt;source media="(min-width: 400px)" srcset="pic-med.jpg"&gt;
  822. <strong>&lt;img src="small.jpg" alt="…"&gt;</strong>
  823. &lt;/picture&gt;</code></pre>
  824. <p>On a device with 320px-wide display, the fallback <code>img</code> is selected.</p>
  825. </figcaption>
  826. </figure>
  827. <p>If none of the <code>source</code> elements match, the fallback <code>img</code> is loaded as the default source—no user ends up left without an image.</p>
  828. <p>
  829. <figure>
  830. <img src="https://static2.bocoup.com/assets/2015/11/05183211/sizer-soze.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/sizer-soze-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/sizer-soze-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/sizer-soze-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/sizer-soze-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/sizer-soze-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/sizer-soze.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  831. <figcaption><a href="http://SizerSoze.org">SizerSoze.org</a></figcaption>
  832. </figure>
  833. <p>What all these different syntaxes have in common is that they all give us options for delivering only the image sources that are most appropriate to a user’s context. For a user on a 320 pixel wide display, that will all add up to reducing the image weight of the HBR homepage by an estimated eighty eight percent. We’ve still got some work to do, and none of this is live just yet—but as far as the markup goes, this work took one of us a couple of hours. It’s complicated at first, sure, but once it clicks, a little bit of work here goes a long way for our users.</p>
  834. <p>
  835. <figure>
  836. <img src="https://static2.bocoup.com/assets/2015/11/05183211/support.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/support-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/support-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/support-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/support-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/support-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/support.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  837. <figcaption>
  838. <a href="http://caniuse.com/#search=srcset">caniuse: <code>srcset</code></a><br />
  839. <a href="http://caniuse.com/#search=picture">caniuse: <code>picture</code></a><br />
  840. </figcaption>
  841. </figure>
  842. <p>As new as these standards are, the list of supported browsers is growing fast. All these syntaxes have been available since Chrome 38, Opera 27, and Firefox 38 (with a few caveats). Last but not least: the first version of Microsoft Edge will ship with about half of these features.</p>
  843. <p>
  844. <figure>
  845. <img src="https://static2.bocoup.com/assets/2015/11/05183211/picturefill.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/picturefill-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/picturefill-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/picturefill-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/picturefill-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/picturefill-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/picturefill.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  846. <figcaption><a href="http://picturefill.responsiveimages.org">Picturefill</a></figcaption>
  847. </figure>
  848. <p>For browsers that don’t yet support any or all of these syntaxes, there’s a polyfill that has us all covered. Scott Jehl wrote a script that mimicked the behavior of the <code>picture</code> element way back when we were writing the original spec, just to get our heads around how it might work. Since then, that script has evolved into a full-blown responsive images polyfill. <code>picture</code>, <code>srcset</code>, <code>sizes</code>, <code>types</code>, all of it.</p>
  849. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/faster-websites.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/faster-websites-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/faster-websites-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/faster-websites-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/faster-websites-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/faster-websites-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/faster-websites.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  850. <p>Now that our websites are smaller, we can focus on making them even faster. And there’s sort of a plot twist here: when we talk about performance on the web, we’re not necessarily talking about making things go faster, like so many Vin Diesels. More often than not, we’re talking about <em>perceived</em> performance—making the site look and feel ready, even if it isn’t completely done loading out assets.</p>
  851. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/criticalcss.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/criticalcss-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/criticalcss-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/criticalcss-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/criticalcss-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/criticalcss-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/criticalcss.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  852. <p>Even though they’re some of the smallest requests on the front end, requests for external stylesheets can have the biggest impact on the time it takes a page to render.</p>
  853. <p>
  854. <figure data-toggle="figcaption">
  855. <img src="https://static2.bocoup.com/assets/2015/11/05183211/blocking.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/blocking-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/blocking-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/blocking-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/blocking-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/blocking-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/blocking.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  856. <figcaption>
  857. <pre><code>&lt;head&gt;
  858. &lt;link href="all.css" rel="stylesheet"&gt;
  859. &lt;/head&gt;</code></pre>
  860. </figcaption>
  861. </figure>
  862. <p>When we talk about performance, you’ll hear a lot of talk about “blocking requests”—meaning that the page won’t even start to render until those assets have been requested and fully transferred. There’s a good reason for that: if our CSS didn’t block, we’d see flashes of unstyled content as the page loaded—a flash of plain text before the CSS is applied. But for assets that might not be necessary right away, we could drastically improve perceived performance by avoiding that blocking behavior.</p>
  863. <p>
  864. <figure data-toggle="figcaption">
  865. <img src="https://static2.bocoup.com/assets/2015/11/05183211/media-attr.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/media-attr-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/media-attr-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/media-attr-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/media-attr-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/media-attr-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/media-attr.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  866. <figcaption>
  867. <pre><code>&lt;head&gt;
  868. &lt;link href="all.css" rel="stylesheet"&gt;

  869. &lt;link href="medium.css" media="(min-width: 35em)" rel="stylesheet"&gt;

  870. &lt;link href="large.css" media="(min-width: 55em)" rel="stylesheet"&gt;
  871. &lt;/head&gt;</code></pre>
  872. </figcaption>
  873. </figure>
  874. <p>In a perfect world, we’d be able to use the <code>media</code> attribute that we’ve come to know and love from responsive images to serve only the stylesheets that apply to the user’s browsing context.</p>
  875. <p>
  876. <figure data-toggle="figcaption">
  877. <img src="https://static2.bocoup.com/assets/2015/11/05183211/all-downloaded.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/all-downloaded-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/all-downloaded-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/all-downloaded-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/all-downloaded-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/all-downloaded-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/all-downloaded.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  878. <figcaption>
  879. <table class="downloaded-table">
  880. <thead>
  881. <tr>
  882. <th><code>media="…"</code></th>
  883. <th>iOS</th>
  884. <th>Android</th>
  885. <th>Chrome</th>
  886. <th>IE10</th>
  887. <th>Firefox</th>
  888. <th>Opera</th>
  889. </tr>
  890. </thead>
  891. <tbody>
  892. <tr>
  893. <th scope="row"><code>only all</code></th>
  894. <td>Downloaded</td>
  895. <td>Downloaded</td>
  896. <td>Downloaded</td>
  897. <td>Downloaded</td>
  898. <td>Downloaded</td>
  899. <td>Downloaded</td>
  900. </tr>
  901. <tr>
  902. <th scope="row"><code>handheld</code></th>
  903. <td>Downloaded</td>
  904. <td>Downloaded</td>
  905. <td>Downloaded</td>
  906. <td>Downloaded</td>
  907. <td>Downloaded</td>
  908. <td>Downloaded</td>
  909. </tr>
  910. <tr>
  911. <th scope="row"><code>tv</code></th>
  912. <td>Downloaded</td>
  913. <td>Downloaded</td>
  914. <td>Downloaded</td>
  915. <td>Downloaded</td>
  916. <td>Downloaded</td>
  917. <td>Downloaded</td>
  918. </tr>
  919. <tr>
  920. <th scope="row"><code>(min-width: 7777px)</code></th>
  921. <td>Downloaded</td>
  922. <td>Downloaded</td>
  923. <td>Downloaded</td>
  924. <td>Downloaded</td>
  925. <td>Downloaded</td>
  926. <td>Downloaded</td>
  927. </tr>
  928. <tr>
  929. <th scope="row"><code>(min-device-width: 9999999in)</code></th>
  930. <td>Downloaded</td>
  931. <td>Downloaded</td>
  932. <td>Downloaded</td>
  933. <td>Downloaded</td>
  934. <td>Downloaded</td>
  935. <td>Downloaded</td>
  936. </tr>
  937. <tr>
  938. <th scope="row"><code>(min-device-pixel-ratio: six?)</code></th>
  939. <td>Downloaded</td>
  940. <td>Downloaded</td>
  941. <td>Downloaded</td>
  942. <td>Downloaded</td>
  943. <td>Downloaded</td>
  944. <td>Downloaded</td>
  945. </tr>
  946. <tr>
  947. <th scope="row"><code>(dinosaurs: friggin’ sweet)</code></th>
  948. <td>Downloaded</td>
  949. <td>Downloaded</td>
  950. <td>Downloaded</td>
  951. <td>Downloaded</td>
  952. <td>Downloaded</td>
  953. <td>Downloaded</td>
  954. </tr>
  955. <tbody>
  956. </table>
  957. </figcaption>
  958. </figure>
  959. <p>That doesn’t work, and there’s a good reason for that: media queries are designed to respond to changes in context; window size, resolution, and so on. If we didn’t load a stylesheet until a media query applied, we could end up with a flash of unstyled content whenever the user’s context changed. Worse, if their connection dropped out while browsing, they could get stuck with no styles at all.</p>
  960. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/blocking-illus.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/blocking-illus-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/blocking-illus-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/blocking-illus-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/blocking-illus-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/blocking-illus-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/blocking-illus.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  961. <p>Even if a stylesheet doesn’t apply—and could never apply—it has to block the rendering of the page until that asset has been fully downloaded. We end up making users wait for assets they might never need.</p>
  962. <p>
  963. <figure data-toggle="figcaption">
  964. <img src="https://static2.bocoup.com/assets/2015/11/05183211/papayawhip.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/papayawhip-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/papayawhip-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/papayawhip-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/papayawhip-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/papayawhip-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/papayawhip.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  965. <figcaption>
  966. <pre><code>&lt;head&gt;
  967. &lt;style&gt;
  968. body {
  969. background: papayawhip;
  970. }
  971. &lt;/style&gt;
  972. &lt;/head&gt;</code></pre>
  973. </figcaption>
  974. </figure>
  975. <p>We could avoid all this—<em>technically</em>—by inlining all of our CSS in the head of the page. Just… bust out a copy of Frontpage and party like it’s 1999. No blocking requests, sure, but this would suck to maintain. And bloat the page. We’d also completely lose caching.</p>
  976. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/14kb.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/14kb-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/14kb-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/14kb-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/14kb-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/14kb-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/14kb.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  977. <p>So, we’re totally gonna do this. But—hear me out—we’re going to do it in a very calculated way.</p>
  978. <p>A new TCP/IP connection can include up to 10 TCP packets—about 14KB of data—in the very first response from a server. That’s more than enough to get our markup into the browser, but doesn’t include any external requests. Just the markup… and any styles that we inline in the head of the document.</p>
  979. <p>If we inline our “above-the-fold” styles and include them in that initial 14KB transfer, we could deliver a <em>visually</em> complete page in as much time as it takes to make an initial TCP/IP connection.</p>
  980. <p>
  981. <figure>
  982. <img src="https://static2.bocoup.com/assets/2015/11/05183211/grunt-criticalcss.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/grunt-criticalcss-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/grunt-criticalcss-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/grunt-criticalcss-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/grunt-criticalcss-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/grunt-criticalcss-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/grunt-criticalcss.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  983. <figcaption><a href="https://www.npmjs.com/package/criticalcss">Grunt CriticalCSS</a></figcaption>
  984. </figure>
  985. <p>Now, we’d never want to take the time to comb through all our CSS for those above-the-fold styles; this is a case for automation. This Grunt task renders the page in a headless browser and parses out all the necessary styles into their own stylesheet, ready to be included in the head of your page.</p>
  986. <p>
  987. <figure data-toggle="figcaption">
  988. <img src="https://static2.bocoup.com/assets/2015/11/05183211/critcss-head.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/critcss-head-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/critcss-head-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/critcss-head-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/critcss-head-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/critcss-head-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/critcss-head.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  989. <figcaption>
  990. <pre><code>&lt;head&gt;
  991. &lt;style&gt;
  992. /<em> Critical CSS goes here </em>/
  993. &lt;/style&gt;</p>
  994. <p>&lt;script&gt;
  995. function loadCSS( href ){
  996. }
  997. loadCSS( "all.css" );
  998. &lt;script&gt;
  999. &lt;noscript&gt;
  1000. &lt;link href="full.css" rel="stylesheet"&gt;
  1001. &lt;/noscript&gt;
  1002. &lt;/head&gt;</code></pre>
  1003. </figcaption>
  1004. </figure>
  1005. <p>The head of our pages should now look something like this. We’ll have a block of our critical CSS inlined. Once we have those styles in place, we’ll use a little JavaScript to inject all our non-critical stylesheets asynchronously. It happens quickly enough that there’s no visual lag, even if the user scrolls quickly. I inline this function as well—there’d be no sense in removing a blocking request for an external stylesheet only to replace it with a blocking request for an external script, after all. I add an old-fashioned <code>link</code> to the stylesheet inside a <code>noscript</code> tag as well, because there’s no harm.</p>
  1006. <p>We’ve introduced a dependency on JavaScript for all our styles, and since this is the first thing we’re running on the page, we don’t have to worry so much about JavaScript breaking down on us here. We may as well cover the small number of users with JavaScript wholesale disabled while we’re at it.</p>
  1007. <p>It’s easy to feel a little squeamish about a big block of CSS in the <code>head</code> of your documents, but you shouldn’t worry about this from a maintenance standpoint any more than you worry about minification now. Generating CriticalCSS should be a <em>build</em> step; you shouldn’t ever need to muck around with it by hand. This’ll be up on HBR soon too.</p>
  1008. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/async-webfonts.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/async-webfonts-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/async-webfonts-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/async-webfonts-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/async-webfonts-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/async-webfonts-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/async-webfonts.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1009. <p>Once we have a page showing up as quickly as possible, we can start looking for more specific points of failure—and believe it or not, webfonts are one of the biggest ones.</p>
  1010. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/font-delay.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/font-delay-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/font-delay-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/font-delay-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/font-delay-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/font-delay-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/font-delay.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1011. <p>Most browsers will wait about three seconds for a font to load before giving up and showing the fallback text, which is a lifetime in performance terms. But WebKit-based browsers—Safari, older Android, and Blackberry—wait 30 seconds. This is a huge single point of failure for a site, no matter how fast it loads otherwise.</p>
  1012. <p>
  1013. <figure data-toggle="figcaption">
  1014. <img src="https://static2.bocoup.com/assets/2015/11/05183211/mitt.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/mitt-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/mitt-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/mitt-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/mitt-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/mitt-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/mitt.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1015. <figcaption>
  1016. <blockquote><p>
  1017. Hey @slate, it matters how fast your webfonts load.<br />
  1018. <cite><a href="https://twitter.com/jmuspratt/status/561239961924403200">@Muspratt</a></cite>
  1019. </p></blockquote>
  1020. </figcaption>
  1021. </figure>
  1022. <p>And it doesn’t necessarily fail in the kind of ways we might expect.</p>
  1023. <p>The “not” in this headline was italicized, which meant a request for another font file. That request timed out. Things got a little scary for about thirty seconds there.</p>
  1024. <p>
  1025. <figure data-toggle="figcaption">
  1026. <img src="https://static2.bocoup.com/assets/2015/11/05183211/font-face.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/font-face-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/font-face-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/font-face-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/font-face-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/font-face-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/font-face.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1027. <figcaption>
  1028. <pre><code>@font-face {
  1029. font-family: 'WebFont';
  1030. src: url('webfont.eot');
  1031. src: url('webfont.eot?#iefix') format('embedded-opentype'),
  1032. url('webfont.woff') format('woff'),
  1033. url('webfont.ttf') format('truetype');
  1034. font-weight: normal;
  1035. }</p>
  1036. <p>@font-face {
  1037. font-family: 'WebFont';
  1038. src: url('webfont-bold.eot');
  1039. src: url('webfont-bold.eot?#iefix') format('embedded-opentype'),
  1040. url('webfont-bold.woff') format('woff'),
  1041. url('webfont-bold.ttf') format('truetype');
  1042. font-weight: bold;
  1043. }</code></pre>
  1044. </figcaption>
  1045. </figure>
  1046. <p>Font-face has a pretty smart syntax; the fallback pattern is built-in, so no matter what format a browser needs, we’re really only looking at one request for each file. For a while, I advocated loading all our type asynchronously—and that still works, but the issue isn’t <em>loading</em> the fonts so much as <em>applying</em> them. If our stylesheet calls for text to use a font that isn’t available at render time, that text isn’t shown until the font is available.</p>
  1047. <p>
  1048. <figure>
  1049. <img src="https://static2.bocoup.com/assets/2015/11/05183211/font-loading-spec.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/font-loading-spec-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/font-loading-spec-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/font-loading-spec-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/font-loading-spec-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/font-loading-spec-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/font-loading-spec.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1050. <figcaption><a href="https://drafts.csswg.org/css-font-loading/">https://drafts.csswg.org/css-font-loading/</a></figcaption>
  1051. </figure>
  1052. <p>So, instead of messing with <code>@font-face</code>—and potentially breaking a really smart native loading pattern—the “font events” spec gives us a JavaScript API that tells us when our font files are fully loaded. We can <em>then</em> apply them to the page. Since they’re not being applied during the initial render, they won’t block rendering.</p>
  1053. <p>
  1054. <figure data-toggle="figcaption">
  1055. <img src="https://static2.bocoup.com/assets/2015/11/05183211/font-events.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/font-events-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/font-events-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/font-events-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/font-events-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/font-events-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/font-events.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1056. <figcaption>
  1057. <pre><code>&lt;script&gt;
  1058. document.fonts.ready().then(function() {
  1059. document.documentElement.setAttribute( "class", "fonts-ready" );
  1060. });
  1061. &lt;/script&gt;
  1062. &lt;style&gt;
  1063. p {
  1064. font-family: sans-serif;
  1065. }
  1066. .fonts-ready p {
  1067. font-family: Garage Gothic;
  1068. }
  1069. &lt;/style&gt;
  1070. </code></pre>
  1071. </figcaption>
  1072. </figure>
  1073. <p>The font events API is pretty simple; a couple lines of JavaScript to say “once all the fonts are fully loaded, add a <code>fonts-ready</code> class to the HTML element. Then, in our CSS, we qualify the webfont family with that class.</p>
  1074. <p>That’s it; you’re done. No changes to anything else.</p>
  1075. <p>Now you might see your fallback fonts for a split second before the webfont is loaded under bad browsing conditions, but I honestly consider that a feature—whatever it is that your user wanted to read is available right away.</p>
  1076. <p>
  1077. <figure>
  1078. <img src="https://static2.bocoup.com/assets/2015/11/05183211/ffobserver.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/ffobserver-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/ffobserver-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/ffobserver-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/ffobserver-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/ffobserver-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/ffobserver.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1079. <figcaption><a href="https://github.com/bramstein/fontfaceobserver">https://github.com/bramstein/fontfaceobserver</a></figcaption>
  1080. </figure>
  1081. <p>This is a brand new spec; I <em>think</em> it’s only available in Chrome. Bram Stein put together a great polyfill for it, though.</p>
  1082. <p>
  1083. <figure data-toggle="figcaption">
  1084. <img src="https://static2.bocoup.com/assets/2015/11/05183211/rich-robertson.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/rich-robertson-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/rich-robertson-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/rich-robertson-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/rich-robertson-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/rich-robertson-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/rich-robertson.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1085. <figcaption>
  1086. <blockquote><p>
  1087. Too many times woodworkers make something and think it’s nice, but it doesn’t solve problems for people.<br />
  1088. <cite>Rich Robertson</cite>
  1089. </p></blockquote>
  1090. </figcaption>
  1091. </figure>
  1092. <p>So, listen. If you’ll indulge me, I’m gonna talk about woodworking one last time—and I’m gonna talk about myself a little bit after all.</p>
  1093. <p>I wasn’t a fancy woodworker, prior to a few years ago. I was a contractor; I did grunt work. Additions; roofing. If you live in Cambridge, I might have built your porch. It wasn’t glamorous work; there were no intricate carvings, no exotic South American hardwoods. I never cut a dovetail. There was cheap pine and nailguns and roofing shingles nobody would ever see.</p>
  1094. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/porch.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/porch-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/porch-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/porch-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/porch-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/porch-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/porch.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1095. <p>I loved that work. I loved it deeply, but not because I planned on winning any awards. It was simple, functional work. I walk by a lot of it every day—there’s a set of stairs a block from my apartment that those homeowners will have forever. They outlived my father. They’ll outlive me. No one will ever think about them when they’re carrying groceries into their home, because we did our jobs the right way. No one notices when their windows aren’t drafty, but they’d notice if they were.</p>
  1096. <p>That work was beautiful to me because it was invisible. Because we built purpose. We didn’t build a porch, we built the place you drink your morning coffee. We didn’t build a roof: we protected a home.</p>
  1097. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/roof.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/roof-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/roof-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/roof-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/roof-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/roof-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/roof.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1098. <p>That’s the meaning I take from working on the web, as ephemeral as this medium might seem sometimes. When we work harder, we get better at doing things the right way. When we get better at doing things the right way, we build something more important than a website; something that will outlast any of us here.</p>
  1099. <p>We build a connection between every single person in the world and all the information in the world. We do more than just build websites—I don’t <em>care</em> about websites. I care about <em>purpose</em>.</p>
  1100. <p><img src="https://static2.bocoup.com/assets/2015/11/05183211/thanks.jpg" srcset="https://static3.bocoup.com/assets/2015/11/05183211/thanks-383x215.jpg 383w, https://static2.bocoup.com/assets/2015/11/05183211/thanks-500x281.jpg 500w, https://static1.bocoup.com/assets/2015/11/05183211/thanks-640x360.jpg 640w, https://static3.bocoup.com/assets/2015/11/05183211/thanks-700x394.jpg 700w, https://static2.bocoup.com/assets/2015/11/05183211/thanks-1100x619.jpg 1100w, https://static1.bocoup.com/assets/2015/11/05183211/thanks.jpg 1920w" sizes="(min-width: 85em) 668px, (min-width: 70em) 62.962963vw, (min-width: 60em) 70.3703704vw, (min-width: 35em) 77.7777778vw, 85.1851852vw" alt=""></p>
  1101. <p>Thank you.</p></p>
  1102. </article>
  1103. </section>
  1104. <nav id="jumpto">
  1105. <p>
  1106. <a href="/david/blog/">Accueil du blog</a> |
  1107. <a href="https://bocoup.com/weblog/smaller-faster-websites">Source originale</a> |
  1108. <a href="/david/stream/2019/">Accueil du flux</a>
  1109. </p>
  1110. </nav>
  1111. <footer>
  1112. <div>
  1113. <img src="/static/david/david-larlet-avatar.jpg" loading="lazy" class="avatar" width="200" height="200">
  1114. <p>
  1115. Bonjour/Hi!
  1116. Je suis <a href="/david/" title="Profil public">David&nbsp;Larlet</a>, je vis actuellement à Montréal et j’alimente cet espace depuis 15 ans. <br>
  1117. Si tu as apprécié cette lecture, n’hésite pas à poursuivre ton exploration. Par exemple via les <a href="/david/blog/" title="Expériences bienveillantes">réflexions bimestrielles</a>, la <a href="/david/stream/2019/" title="Pensées (dés)articulées">veille hebdomadaire</a> ou en t’abonnant au <a href="/david/log/" title="S’abonner aux publications via RSS">flux RSS</a> (<a href="/david/blog/2019/flux-rss/" title="Tiens c’est quoi un flux RSS ?">so 2005</a>).
  1118. </p>
  1119. <p>
  1120. Je m’intéresse à la place que je peux avoir dans ce monde. En tant qu’humain, en tant que membre d’une famille et en tant qu’associé d’une coopérative. De temps en temps, je fais aussi des <a href="https://github.com/davidbgk" title="Principalement sur Github mais aussi ailleurs">trucs techniques</a>. Et encore plus rarement, <a href="/david/talks/" title="En ce moment je laisse plutôt la place aux autres">j’en parle</a>.
  1121. </p>
  1122. <p>
  1123. Voici quelques articles choisis :
  1124. <a href="/david/blog/2019/faire-equipe/" title="Accéder à l’article complet">Faire équipe</a>,
  1125. <a href="/david/blog/2018/bivouac-automnal/" title="Accéder à l’article complet">Bivouac automnal</a>,
  1126. <a href="/david/blog/2018/commodite-effondrement/" title="Accéder à l’article complet">Commodité et effondrement</a>,
  1127. <a href="/david/blog/2017/donnees-communs/" title="Accéder à l’article complet">Des données aux communs</a>,
  1128. <a href="/david/blog/2016/accompagner-enfant/" title="Accéder à l’article complet">Accompagner un enfant</a>,
  1129. <a href="/david/blog/2016/senior-developer/" title="Accéder à l’article complet">Senior developer</a>,
  1130. <a href="/david/blog/2016/illusion-sociale/" title="Accéder à l’article complet">L’illusion sociale</a>,
  1131. <a href="/david/blog/2016/instantane-scopyleft/" title="Accéder à l’article complet">Instantané Scopyleft</a>,
  1132. <a href="/david/blog/2016/enseigner-web/" title="Accéder à l’article complet">Enseigner le Web</a>,
  1133. <a href="/david/blog/2016/simplicite-defaut/" title="Accéder à l’article complet">Simplicité par défaut</a>,
  1134. <a href="/david/blog/2016/minimalisme-esthetique/" title="Accéder à l’article complet">Minimalisme et esthétique</a>,
  1135. <a href="/david/blog/2014/un-web-omni-present/" title="Accéder à l’article complet">Un web omni-présent</a>,
  1136. <a href="/david/blog/2014/manifeste-developpeur/" title="Accéder à l’article complet">Manifeste de développeur</a>,
  1137. <a href="/david/blog/2013/confort-convivialite/" title="Accéder à l’article complet">Confort et convivialité</a>,
  1138. <a href="/david/blog/2013/testament-numerique/" title="Accéder à l’article complet">Testament numérique</a>,
  1139. et <a href="/david/blog/" title="Accéder aux archives">bien d’autres…</a>
  1140. </p>
  1141. <p>
  1142. On peut <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">échanger par courriel</a>. Si éventuellement tu souhaites que l’on travaille ensemble, tu devrais commencer par consulter le <a href="http://larlet.com">profil dédié à mon activité professionnelle</a> et/ou contacter directement <a href="http://scopyleft.fr/">scopyleft</a>, la <abbr title="Société coopérative et participative">SCOP</abbr> dont je fais partie depuis six ans. Je recommande au préalable de lire <a href="/david/blog/2018/cout-site/" title="Attention ce qui va suivre peut vous choquer">combien coûte un site</a> et pourquoi je suis plutôt favorable à une <a href="/david/pro/devis/" title="Discutons-en !">non-demande de devis</a>.
  1143. </p>
  1144. <p>
  1145. Je ne traque pas ta navigation mais mon
  1146. <abbr title="Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33.184162340">hébergeur</abbr>
  1147. conserve des logs d’accès.
  1148. </p>
  1149. </div>
  1150. </footer>
  1151. <script type="text/javascript">
  1152. ;(_ => {
  1153. const jumper = document.getElementById('jumper')
  1154. jumper.addEventListener('click', e => {
  1155. e.preventDefault()
  1156. const anchor = e.target.getAttribute('href')
  1157. const targetEl = document.getElementById(anchor.substring(1))
  1158. targetEl.scrollIntoView({behavior: 'smooth'})
  1159. })
  1160. })()
  1161. </script>