Should I minify PHP documents?

I have read about why minifying lengthy HTML, CSS and Javascript documents can increase page load speed. Is it also good to minify lengthy PHP files that don’t necessarily contain pieces of HTML, CSS and Javascript for load speed purposes?

The reason you minify HTML, CSS, and Javascript is because that is sent to the user for them to download and that reduces the amount of data downloaded. It’s actually not that important unless you have very large files, and even then is usually micro-optimization. HTML is rarely minified.

PHP is never sent to the user. It’s all ran on the server and the user usually isn’t even aware anything ever happened. All they get is HTML, CSS, and Javascript.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.