5 ms·
While peeking at the source, I noticed that the doctype declaration is missing a space. It currently reads <!doctypehtml>, but it should be <!doctype html>
by 98469056 2y ago
While peeking at the source, I noticed that the doctype declaration is missing a space. It currently reads <!doctypehtml>, but it should be <!doctype html>
- BugsJustFindMe 2y agoMaybe their javascript adds it back in :)
- palsecam 2y ago`<!doctype html>` can be minified into `<!doctypehtml>`. It’s, strictly speaking, invalid HTML, but it still successfully triggers standards mode. See https://GitHub.com/kangax/html-minifier/pull/970 https://GitHub.com/kangax/html-minifier/pull/970 / https://HTML.spec.WHATWG.org/multipage/parsing.html#parse-error-missing-whitespace-before-doctype-name https://HTML.spec.WHATWG.org/multipage/parsing.html#parse-er... (I too use that trick on https://FreeSolitaire.win https://FreeSolitaire.win)
- saagarjha 2y agoWhy would you do this?
- palsecam 2y agoTo have FreeSolitaire.win homepage be only 20.7 kB over the wire. That’s for the whole game: graphics are inline SVGs, JS & CSS are embedded in <script> and <style> elements.
- saagarjha 2y agoRight but surely skipping that space wasn't that much of a win
- lifthrasiir 2y agoTo be clear, you can minimize much further than what you already have. For example you haven't fully minified SVG, which can be also replaced with just symbol characters. Saving a single space from `<!doctype html>` is insignificant compared to that.
- novoreorx 2y agoThis would be another interesting story about web optimization if you wrote a post about it! :)
- KTibow 2y agoSounds like this is from a minifier that removes as much as it can [0] 0: https://github.com/KTibow/KTibow/issues/3#issuecomment-2336790657 https://github.com/KTibow/KTibow/issues/3#issuecomment-23367...