7 ms·
I hate to be negative, but what really is the point of this? That a simple webpage without any content can be fast? Of course it can. Is it desirable to inli
by jlmorton 10y ago
I hate to be negative, but what really is the point of this? That a simple webpage without any content can be fast? Of course it can.
Is it desirable to inline your CSS, "like a boss?" Maybe if you have one single web page. What if you have dynamic content and your users intend to browse more than one page? With externalized CSS, that is all cached.
Same with images. If I'm building a web application, I certainly do not want inlined images. I want those on a CDN, cached, and I want the page to load before the images.
Not only is this not particularly useful advice, it's bad advice.
- KirinDave 10y agoIt also seems somewhat antiquated. As service-worker comes online we can... do a lot more with a more naive <link> method.
- bmon 10y agoNot to mention the improvements in http2.
- kevin_thibedeau 10y agoIt is relevant for resource limited IoT devices. It can be a struggle to get embedded web sites running fast using modern frameworks. Throw in TLS with large keys and you enter a whole new world of slow where it pays to shave off every byte possible.
- simbalion 10y agothe guy says he's not an idiot then brags about spending $30 per month on a VPS (idiot), for a single-page static HTML website with all inline-code (idiot+1). It's not being negative to point out the glaring flaws in a person's statements. My assumption is the entire thing is an advertisement for that hosting service.
- mikepurvis 10y agoAlso, whether the VPS has an SSD or not is totally irrelevant— if you really were serving a single page it would be cached in the memory of your webserver. (Or better yet, serve the thing off S3 and let Amazon be your CDN.)
- simbalion 10y agoI'm not saying a VPS is not appropriate for a static HTML web-page, but there are perfectly capable VPSes avaible for $3.50 to $5. I'm not in agreement with many of the commenters regarding CDNs. I don't believe in a free lunch. Free software is one thing, but CDNs require infrastructure, which incur costs. Somewhere, the people offering those services expect to make those costs back. You'll either pay for it directly, or you'll pay for leeching off someone else's bill in karma. For a very tiny, low-traffic, low-bandwidth website, I think not using a CDN is perfectly reasonable.
- ajdlinux 10y agoEconomies of scale...
- dragontamer 10y agoGet a decent shared host. Just because Godaddy sucks doesn't mean that all shared hosting sucks. NearlyFreeSpeech.net is fine for most people, or Amazon S3 if you're into AWS / webgui stuff. If you're actually using a decent amount of bandwidth (ie: image hosting), something like Hawkhost.com would be good. Just gotta stay away from EIG (https://en.wikipedia.org/wiki/Endurance_International_Group https://en.wikipedia.org/wiki/Endurance_International_Group), which is a conglomerate that's buying up all the shared hosts and making them crappy. Bam. Now you have economies of scale AND far cheaper hosting than any VPS.
- simbalion 10y agoKeeping in mind that you can get a VPS for as low as $3.50 per month, I don't see that there is ever a reason to use shared hosting, and several reasons not to, performance is only one of them. If you're website is that unimportant, then you could probably get by with any free hosting services where your page would be yourpage.serviceprovider.tld
- vacri 10y agoWhere does it say that the VPS is used only for that one page?
- failrate 10y agoIt doesn't. It isn't. It appears that there are other projects hosted on the same site. Btw, the pages load quickly.
- Annatar 10y agothe guy says he's not an idiot then brags about spending $30 per month on a VPS (idiot), You can always go with cheap, fully virtualized GNU/Linux server, or you can go with a virtual, true UNIX server running at the speed of bare metal[1]. Your choice, but quality, correctness of operation, data integrity and performance still cost something. It you don't care about any of those things, fork out $5 for the alternative and call it a day. [1] http://www.joyent.com/ http://www.joyent.com/
- webtechgal 10y agoNot disrespecting your opinion here, but $5 Digital Ocean droplets[1] have been working quite well for me as well as for nearly two dozens of my clients, spanning across the last several years (taking into account all the four important parameters you've specified: quality, correctness of operation, data integrity and performance). My (limited) experience with Vultr[2] has also been fairly satisfactory. [1] https://www.digitalocean.com/ https://www.digitalocean.com/ [2] https://www.vultr.com/pricing/ https://www.vultr.com/pricing/
- Annatar 10y agoAs far as I am aware, Digital Ocean is running on Linux, and because Linux requires turning off memory overcommit and integrating ZFS on Linux, at a minimum, there is no correctness of operation. As there is no fault management architecture (like fmadm), and support for debugging the kernel and binaries is incomplete (no mdb, no kernel debug mode, no kdb, incomplete DWARF support), there really can be no assertion about correctness of operation. Correctness of operation does not only refer to end-to-end data integrity, but also to adequate capability to diagnose and inspect system state, in addition to being able to deliver correct output in face of severe software or hardware failures. Linux is out as far as all of those. In other words, if you want JustWorks(SM), rock solid substrate for (web)applications, anybody not running on FreeBSD, OpenBSD, or some illumos derivative like SmartOS is out, at least for me. Perhaps your deployment is different, but I don't want to have to wake up in the middle of the night. I want for the OS to continue working correctly even if hardware underneath is busted, so I can deal with it on my own schedule, and not that of managers'.
- ajmurmann 10y agoIt's also a security issue and you should set up CSP to prohibit online CSS. See a random Google search result http://dontkry.com/posts/code/disable-inline-styles.html http://dontkry.com/posts/code/disable-inline-styles.html or like I did read "The Tangled Web" Edit: that's obviously a non-issue in this particular case since everything is static. But as a best practice this needs to be considered and inline CSS doesn't make you a boss.
- ejcx 10y agoYou are completely wrong. Inline styles on a static page is not a security issue. If you read that blog post you linked to, you would know this. CSP will do absolutely nothing for a single static html page containing all assets it needs as inline.
- ajmurmann 10y agoYes, of course that's correct. And I wouldn't have felt that pointing out that it can be is necessary if he hadn't written that he is inlining it "like a boss". That makes it sound like it's some awesome best practices we all should be adhering to.
- bigiain 10y agoSo if I'm reading that page correctly, the basic gist of the claim is: If we only do a half assed job of sanitising user input by attempting to blacklist whatever javascript we can think of, we'll still be open to XSS attacks from people smarter than us who put css into our user supplied data, so the answer is to prohibit inline CSS - not to properly sanitise user supplied data. I think there are better pieces of security advice around than that...
- ajmurmann 10y agoWhy not do both and be safe if your sensitization has a bug?
- always_good 10y ago
- acagle 10y agoWe know that if speed is your goal there are tradeoffs you will have to deal with, such as inline images and css that are harder to maintain. This is a well known architectural tradeoff (along with usability vs security). If you are willing to pay for your load speed in the form of increased page complexity and reduced scalability, this is a legitimate option.
- nhebb 10y agoWith the affiliate link to the VPS host, it's essentially just a marketing page.
- twhb 10y agoThis guy's advice is exactly what Google advises you to do, and exactly what Google does. You say this website is only fast because it's "without any content". If there's no content then tell me how it communicated its point so clearly. If it's inherently fast then tell me why the same thing posted to Medium is so slow. A hallmark of a great solution is that people who see it decide the problem must not have been very hard. http://www.csd.uwo.ca/~magi/personal/humour/Computer_Audience/The%20Parable%20of%20the%20Two%20Programmers.html http://www.csd.uwo.ca/~magi/personal/humour/Computer_Audienc...
- rtpg 10y agoGoogle doesn't do this on their more full-featured apps like G-Mail or Google Docs. Docs ships a bunch of files and stylesheets. Search works well because they have relatively few features to support by default (for things like the calculator I bet they ship that in with the response).
- ebalit 10y agoI think it's implied that these advices are for content pages, for the "old web", and not for single page apps.
- totalcrepe 10y agoHN is neither of the two and IMO represents where people spend most of their time. I think Google's CSS embedding is terrible advice for the meaningful web, but logical advice for adwords landing pages or sites with content so bad or sparse you wont be navigating them.
- aruggirello 10y agoHN has a purposely minimalist stylesheet / layout, with NO icons (except the one Y on the upper left corner), NO images or other media, NO fanciful animations. Not all websites can do without all of that - imagine a photography site, or an e-commerce site, etc. without pictures? I agree though that this is great advice for landing pages; load times are probably among the reasons of most bounces.
- dazc 10y agoI have come across this guy's site before and he does offer some useful tips. Not anything you won't find anywhere else but in a clear and concise manner that almost anyone can understand. There are lots of people self-managing small sites that don't have a clue about any of this stuff - it's a decent resource for such people - nothing more.
- huhtenberg 10y ago> what really is the point of this? An affiliate link in the last paragraph.
- gaur 10y ago> I hate to be negative, but what really is the point of this? To shame people who build slow, bloated websites. Saying that no bloat equates to no content is part of the problem.
- sbarre 10y agoThis kind of attitude is the problem actually.. There is no silver bullet solution to all problems when building webpages, and if you think this guy's advice is catch-all for everyone and that "shaming" people who don't follow those rules is good, then you're a bad developer. Someone else said it elsewhere in this thread, but different contexts need different solutions based on determined use cases and needs.
- notalaser 10y agoThere is no silver bullet, no technology that is good everywhere, but there are things that are bad everywhere, like unnecessary reliance on JavaScript, code and resource bloat and so on. Being diplomatic about it and not assuming everyone who deployed a Joomla installation with a ton of bad plugins because it HAS TO WORK NOW is an idiot is OK. But wrapping bad engineering practices in "different contexts need different solutions based on determined use cases and needs" is a very different story. Obviously, different contexts and use cases need different solutions. That's no excuse to pick the bad ones, nor to pretend they're not really, really bad.
- 72deluxe 10y agoI suppose if we are in control of the backend database that our content is delivered from, we can build a page with inlined images and CSS when the content that drives the page is changed, so it is possible to build quick pages. The main driving point is probably the fact that there is sometimes no need to build pages that rely on all manner of JavaScript etc.
- Loic 10y agoIt really depends of your website usage. I am maintaining a free database of chemical properties. Usually people are landing there from Google and looking at a single page[0] before leaving. To have this single page experience as good as possible, I pack the CSS directly in the HTML. First I packed also the image of the molecule, but it was not good for SEO, because I have quite some visitors coming from search of the drawing of molecules. Google would be smart to index the inlined images, I would switch back to use them. All these optimisation techniques are only good if the context is the right context. That is, you need to pay attention to the assumptions used to make these rules. [0]: https://www.chemeo.com/cid/45-400-7/Octane https://www.chemeo.com/cid/45-400-7/Octane
- TheGreatestEver 10y agoI think it's just an ad to Knownhost SSD hosting.
- coldtea 10y ago>I hate to be negative, but what really is the point of this? That a simple webpage without any content can be fast? Of course it can. No, that most "content" making webpages slow is useless BS bloat.
- sankalp_sans 10y agoAfter some benchmarking, we did something of this sort on a media site. A middle-fold path works best for us. I'm yet to see any media site do this (yes, we are content-heavy, but we also load fast). Admittedly, the only thing slowing down the page load is the ads, but we don't bombard those either. Link: http://www.sportskeeda.com/?ref=san http://www.sportskeeda.com/?ref=san
- jrmacmillan 10y agoTo be a superior, fast website. Your long comments will only slow it dowwwwnnnn.