DEV Community

Daniel Pertu
Daniel Pertu

Posted on

Our 38 page product site downloads one image file, it is 550 bytes, and there is not a single screenshot on it

Notifio is a desktop app, and the usual way to sell one of those is screenshots. Its website has none. I did not set out to build a site with no images, I noticed afterwards, so I counted what is actually there.

Thirty-eight curl calls, one grep:

curl -s https://notifio.app/alerts/kamernet | grep -o '<img' | wc -l
Enter fullscreen mode Exit fullscreen mode

38 pages. 38 <img> tags. One per page, and it is the same tag on every one of them:

<img alt="" width="18" height="18" decoding="async" data-nimg="1"
     class="opacity-90" style="color:transparent" src="/icon-light.svg"/>
Enter fullscreen mode Exit fullscreen mode

That is the 18 pixel bell in the header. The file behind it is 550 bytes, and it is the same 550 bytes on all 38 pages, so after the first page view it is not even that. It is also the favicon, declared first in the icon list as image/svg+xml, so the browser's second request for it is a cache hit. The only other raster the browser will ever ask for is icon.png, 8.8 KB, and only when iOS wants a home screen icon.

There is no srcset. next/image will not run an SVG through the optimiser without dangerouslyAllowSVG, so it passes the file straight through and the component contributes the width, the height and the lazy-loading attributes rather than any resizing. It is priority, so Next adds it to the preload set, which is why every response on the site carries this:

link: </icon-light.svg>; rel=preload; as="image"
Enter fullscreen mode Exit fullscreen mode

A 550 byte preload hint, repeated in the headers of every page, for a file that is smaller than the header advertising it.

The empty alt is the right answer

<Link href="/" className="flex items-center gap-2 ... uppercase">
  <Image src="/icon-light.svg" alt="" width={18} height={18} priority />
  Notifio
</Link>
Enter fullscreen mode Exit fullscreen mode

alt="" on the only image on the site looks like an accessibility gap and is the opposite. The word "Notifio" is the next node inside the same link, so the link already has an accessible name. Giving the bell alt="Notifio" would make a screen reader announce the brand twice for one link, which is the most common way a decorative logo gets broken by somebody trying to fix it.

157 SVGs that are not images

Nothing else on the site is a file. Every icon, every tick, every chevron, every graph line is an inline <svg> element in the HTML:

38 pages, 2,141,399 bytes of HTML
39,905 bytes of that is inline <svg> markup, 1.9%
157 svg elements in total, a median of 4 per page
Enter fullscreen mode Exit fullscreen mode

The distribution is the interesting part:

page                 html     svgs   svg bytes
/                   93,663      30       8,504   9%
/pricing            26,435      13       2,619  10%
/alerts/funda       54,974       4       1,000   2%
Enter fullscreen mode Exit fullscreen mode

Four on a content page is the header bell plus three ticks. Thirty on the homepage is the animated product demos, which show the desktop app working as moving DOM rather than as a video or a screen recording. That decision is the one that removes images from the whole site: a demo built out of divs needs icons, and icons are 250 bytes of path data each, while a demo built out of a screen capture needs a 400 KB PNG per state and a second set for retina.

The demos cost something real, which I wrote up in Four animated product demos, 997 lines, four copies of the same delay function. They are 997 lines of hand-rolled timers and they had an accessibility hole in them. But the bill for the images is 8,504 bytes of path data, gzipped alongside the HTML, with nothing to request, nothing to lazy-load, no layout shift and no second asset for a high-density display.

The 215 KB image nobody loads

public/ has six files in it, and this is the whole directory:

     32  b7989e6abc9208a182d57a642804601a.txt
    550  icon-light.svg
    552  icon-dark.svg
    578  icon.svg
  8,818  icon.png
214,951  og-image.png
Enter fullscreen mode Exit fullscreen mode

og-image.png is 391 times the size of the only image a page loads, and no visitor ever downloads it. It exists only in two meta tags:

openGraph: { images: [{ url: "/og-image.png", width: 1200, height: 630, alt: "Notifio" }] },
twitter:   { card: "summary_large_image", images: ["/og-image.png"] },
Enter fullscreen mode Exit fullscreen mode

Those bytes are fetched by Slack, by WhatsApp, by whatever renders a link preview, and never by a browser rendering a page. Which makes it the one asset on the site with no performance budget at all, and the reason it is 215 KB of PNG rather than 2 KB of SVG is that link preview renderers will not touch an SVG. It is generated by a script that screenshots a real page with Playwright, a detour I wrote about in Our OG card is a Playwright screenshot.

Two of those six files are referenced nowhere in the codebase. icon-dark.svg and icon.svg do not appear in a single import, metadata object or component, and I went looking:

grep -rn "icon-dark.svg\|\"/icon.svg\"" src/ scripts/   # no matches
Enter fullscreen mode Exit fullscreen mode

They are the light-on-dark and the original versions of the bell from July, kept when the header settled on one of them. They are not inert, either: everything in public/ is a public URL, so notifio.app/icon.svg is live and will stay live, serving 578 bytes of a logo variant that nothing on the site uses. 1,130 bytes of orphan is not a problem worth a commit on its own, but "no referrer anywhere in the repo" is a nice reminder that public/ is the one directory a module graph cannot audit for you.

The 32 byte text file is an IndexNow key, which is the one file in there that is supposed to have no referrer: a search engine fetches it by URL to prove the key is ours. It has its own failure modes, which I went through in A 200 from IndexNow does not mean it read your key.

While I was in there

Counting one thing gets you a second measurement for free, so I ran the headings too:

  • 38 of 38 pages have exactly one <h1>. Not 37. That one is the benefit of generated pages: fifteen alert pages, five comparison pages and eight articles all come out of three templates, and a template cannot forget.
  • One page has a heading skip. The homepage goes h1 straight to h3, because a section heading there was styled down for visual weight and the level went with it. Every other page on the site is clean.

That is the whole audit. One 550 byte image, 157 inline SVGs, one unfetched 215 KB social card, two orphaned icons, one heading skip. The pages are at notifio.app/alerts and notifio.app/pricing if you want to run the grep yourself, and the one <img> is at the top left of every single one of them.

Top comments (0)