DEV Community

Mobeen Ahmed
Mobeen Ahmed

Posted on

No Webfonts, No Frameworks: The Performance Budget I Keep on My Tool Pages

When I rebuilt my video downloader as plain PHP pages on shared hosting, I made one decision before writing a line of code: no webfonts, no frameworks, no build step. Every tool page on ramrom.io is hand-written HTML, one shared CSS file, and a small vanilla JavaScript file. That is the whole front end. It sounds old-fashioned, and honestly it is. But it is a deliberate choice, and it has held up through every page I have added since.

Why I started from zero

A tool page has one job. A visitor pastes a link, taps a button, and gets a file. Everything on the page that does not serve that job is weight the visitor has to download on a phone, quite possibly on a slow mobile connection. A framework would have been comfortable for me, the developer. It would not have been comfortable for the visitor. The download starts with a network request either way, but a 40KB page that renders in a blink beats a 400KB page that looks fancier.

So I set a budget, in plain words rather than a spreadsheet: the homepage should stay under 100KB, and no tool page should need more than one CSS file and one JavaScript file. If something did not fit inside that budget, it did not ship.

What "no webfonts" actually costs me

The first thing people notice is the type. I use the system font stack: -apple-system, Segoe UI, Roboto, sans-serif. The text looks like the rest of the visitor's phone, which is fine, because nobody visits a downloader to admire the typography. Dropping webfonts saved a render-blocking request and a flash of unstyled text on every single visit.

The same thinking applies to CSS. There is one shared stylesheet for all eight tool pages. A fix to a button style lands everywhere at once, and the browser caches the file after the first page, so the second tool page a visitor opens is even lighter. I did not need a design system. I needed one file I could read top to bottom in a minute.

JavaScript, kept small on purpose

The JavaScript is one shared engine file. It handles the paste, the resolve call, the quality dropdown, and the download. Nothing else. I write it by hand, no bundler, and I minify it before uploading, then I test the download flow still works after minifying.

Because there is no framework, there is no framework update to chase and no dependency that can go stale. When I add a feature, I add a few lines to a file I already understand. When something breaks, the file I need to read is the file I wrote.

The trade-offs I accept

This approach is not free. Hand-written pages mean I repeat markup across pages, and a layout change means editing several files. I have accepted that cost because the pages are small and the layout rarely changes. I also accept that the site will never win a design award. It is blue and white, with plain buttons and plain text. That is fine. A tool page is not a portfolio piece.

The one place I almost broke the rule was dark mode. I thought about it, then did not ship it. The blue-and-white theme works, the pages are readable in daylight, and a dark theme would have doubled the CSS I maintain for a feature nobody asked for.

The lesson

A performance budget is not a number in a report. It is a question I ask before adding anything: does this help the visitor download their video faster? A webfont does not. A framework does not. A third analytics script does not. So they stay out, and the page stays fast on the worst connection I can test on, which is a real phone on a real Pakistani mobile network, not a fast office connection.

If you are building a single-purpose tool, try writing the page with nothing in it first, then add only what the job needs. You will be surprised how little that turns out to be.

Top comments (0)