Urgent.News

What's breaking now, across thousands of outlets.

Tech

Is Minifying CSS Necessary? (2023)

The topic of minifying CSS, which involves eliminating all whitespace and comments, has been discussed on the Eleventy Discord platform. The reporter advises against minifying CSS, stating that it adds an unnecessary step in the pipeline. Some have argued that minifying CSS improves performance due to the extra whitespace and comments slowing down the download and parsing process. However, the reporter disagrees, believing that the performance impact is minimal.

To support their argument, the reporter proposes a series of tests comparing minified and unminified CSS files. The tests involve creating large and small CSS files with and without comments, then serving them through eight identical HTML files. These files would be hosted on the same server and accessed using WebPageTest.org to measure the time it takes for the CSS to load and for the content to start rendering.

The reporter conducts the tests and presents the results in a spreadsheet, which can be viewed and tested on specific URLs. Regardless of the approach used, the tests reveal that the difference in performance between minified and unminified CSS files is negligible. The reporter asserts that minifying CSS only serves to obfuscate the code without providing any tangible benefits.

The reporter concludes that for most users, using gzip or Brotli compression is sufficient to optimize the CSS file size. Only large companies with significant loads and a high signal-to-noise ratio in their stylesheets might consider minification, but even then, the reporter doubts the practicality of the added complexity.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at shivjm.blog →

More in Tech

Where code becomes material: Jing Dong’s art of human-machine encounter

Artist and software engineer Jing Dong explores AI, emotion and creativity through interactive art and SoulArts, an app that turns drawings, dreams and reflections into creative exploration.

  • Jing Dong creates AI application SoulArts to transform human expressions into creative material.
  • SoulArts connects sensing, interpretation, transformation, and human response in a recursive system.

More from Tuesday 1 September →