Skip to main content
6 events
when toggle format what by license comment
Aug 10, 2021 at 20:37 vote accept MauricioRobayo
Aug 6, 2021 at 16:48 comment added T.kowshik Yedida @RoToRa 2. Yes you could. But not all people minify html because of the dynamic content which is showed to users, based on preferences, regions, user types etc whatsoever. It is not necessary to minify it in such scenarios but css and js will still be static.
Aug 6, 2021 at 16:20 comment added T.kowshik Yedida @RoToRa 1. HTML actually is rendered based on user request. We can cache HTML too. But if you don't, browser has to always download the content. Whereas js, css and images used in the HTML are static. By default browser caches those static files and won't get downloaded unless there is a hard refresh. Every character occupies some memory including js and styles. As the file gets bigger, it has to download that chunk as I said above. You can switch dev tools in chrome and see the network tab. It will explain clearly what I am saying.
Aug 6, 2021 at 12:12 comment added RoToRa Could you explain points 1 + 2 better, because I don't think they are true. 1) I don't see how including the JS/CSS in HTML makes the files bigger. In total you will have the same file size(s). 2) Technically you could minify JS/CSS inside a HTML file, too.
Aug 5, 2021 at 10:43 comment added Christophe Excellent arguments. And 4. separation of concerns (the HTML content may need localisation in several languages, or updates by the owner of the content, whereas CSS and jS may be more stable and requires different skills)
Aug 5, 2021 at 4:13 history answered T.kowshik Yedida CC BY-SA 4.0