This is a question we are asked by people on a regular basis: “Why is my website slow?” The answer provided here, since 2012, is…
Minification
Minification is a process which can be applied to HTML, javascript (JS) and Cascading Stylesheets (CSS) files, in order to reduce the file size by removing unnecessary characters and spaces.
This can include removing things like comments, as well as whitespace (line breaks, additional spaces and tabs) which are added to aid reading and development, but are not needed by browsers in order to interpret and render the page.
In this way, (good) minification is a form of lossless compression, which makes your HTML, JS and CSS files as small as possible, before they are deflated (or Gzipped) and sent to the browser, to ensure your file sizes, and consequently time spent receiving your website, is kept to an absolute minimum.
In WordPress, we often use a plugin like WP Rocket, with or without a plugin like Autoptimize, in order to minify files. Often we combine this with the powers of concatenation in order to gain additional speed benefits.