12 ms·
Conservative web development
- dbelchamber 8y agoAmen. I would also say that Forbes is another excellent example of the ludicrous level of calls and hostile features.
- PunchTornado 8y agowhy would I want to read a quote of the day before reading the article I'm interested in?
- saagarjha 8y agoWhat, you don't like looking at the ad before the article along with the quote?
- oblio 8y agoThey also ban ad blockers and have a hugely hostile GDPR banner. As in "GDPR-hostile".
- some_account 8y agoForbes refuses to even load the front page if it is not allowed to store cookies on your computer. Cookies are for keeping logged in state. They are not needed to display html. But I don't need Forbes so it's ok.
- rauhl 8y agoY’know, folks complain (with some justification) that Bitcoin wastes a massive amount of energy globally. But almost noöne uses Bitcoin, or mines it; I wonder how much energy is wasted on transporting & executing useless JavaScript. It’d be interesting to know how it compares.
- jeffbarg 8y agoThis definitely interests me as well. Another 'wasteful' mechanism is the nearly-ubiquitous use of JSON over a more optimized format like protocol buffers, etc... It reminds me of another HN discussion here: https://news.ycombinator.com/item?id=9761667 https://news.ycombinator.com/item?id=9761667 I understand that economically the savings in development time usually outweighs the bandwidth costs, but I would be interested in any analysis on how wasteful this is overall.
- tatersolid 8y agoWe tested this at $dayjob and JSON+gzip wins hands down because you already have an optimized native-code parser in the browser. Large-ish arrays of similar JSON objects compress very well with gzip, and ultimately parse more quickly than JS-based protobuf or msgpack, at least in our testing.
- andrethegiant 8y agoI wondered the same thing. I wrote a basic crawler to measure JS footprint on various sites on the web. Most of the JS bloat I found was due to misconfigured webpack configs: leaving development mode on, inline source maps, etc. Tons of whitespace and comments. I tweeted at some of the offenders (https://twitter.com/bundlebloat https://twitter.com/bundlebloat for those interested), but only a few actually fixed the problem.
- azemetre 8y agoAre you willing to post your code for your crawler some where? Sounds like a neat project, shame most people aren't fixing the problem.
- JimDabell 8y agoYou may not need a crawler for this. The HTTP Archive has already done all the crawling for a million URLs from the most popular websites. If one of their existing reports doesn't cover what you need, you can write custom queries using BigQuery: https://httparchive.org/faq#how-do-i-use-bigquery-to-write-custom-queries-over-the-data https://httparchive.org/faq#how-do-i-use-bigquery-to-write-c...
- rbinv 8y ago> And if anyone at Google is reading, you should try recommending these strategies for speeding up pages instead of pushing self-serving faux standards like AMP. They kind of do: https://developers.google.com/speed/docs/insights/rules https://developers.google.com/speed/docs/insights/rules
- PunchTornado 8y agoexactly, google is doing a lot to promote small pages. it is even in their ranking on mobile.
- Sir_Cmpwn 8y agoThey do, sure, but they don't put any teeth into it. AMP pages get special treatment in search results. It's not about promoting fast pages, it's about promoting pages which buy into Google's self-serving AMP nonsense.
- untog 8y agoKind of. They overwhelmingly prioritise AMP, though, because it gives them huge benefits in platform control.
- stupidcar 8y agoCool. Could someone just explain how to build https://app.moqups.com/ https://app.moqups.com/ or https://designer.gravit.io/ https://designer.gravit.io/ using only HTML, CSS and server-side rendering? Otherwise I'll just dismiss this as the same cloud-oriented geriatric yelling that Hacker News has been upvoting for the last 15 years, to absolutely no purpose or result.
- RussianCow 8y agoI came here to say basically this. Complaining that a content-centric site like the New York Times loads 2.8mb of data just to load an article is completely valid because it's entirely unnecessary, and makes the end user experience noticeably worse. But let's not generalize that by dismissing all single-page applications; sometimes a heavy frontend really is the best solution.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- Sir_Cmpwn 8y agoAuthor here. Obviously not all "websites" are suited to be done with HTML and CSS alone. The examples I gave, the New York Times, GitHub, and sr.ht, along with many others, are.
- saagarjha 8y agoThere's nothing wrong with using JavaScript if you really need it. But make sure it's your own JavaScript, not a dozen third-party ad networks.
- zzzeek 8y agoBut what if those ad networks are paying my rent
- 8y ago
- overcast 8y agoThis is my most recent favorite. https://www.ubuntu.com/desktop https://www.ubuntu.com/desktop Total download size is 6.87MB and over 6s to render it, for a page with some nonsense overview text, and four pictures. Completely ludicrous.
- PunchTornado 8y agothe 3 images have over 5MB. no optimization at all I assume.
- oblio 8y agoI wish all common CMSes just did this automatically. Or do they do it, already? (WordPress, Drupal, etc.)
- Twirrim 8y agohttps://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.ubuntu.com%2Fdesktop https://developers.google.com/speed/pagespeed/insights/?url=... suggests that the images aren't that bad, only one image is unoptimised, and you'd only shave off a meg from the final size.
- RussianCow 8y agoRunning the topmost image through Compressor.io gives a ~82% file size reduction with no noticeable image quality loss, and converting the next one from a PNG to a JPEG reduces the size by ~77%. I think there is clearly room for improvement here.
- coding123 8y agoThere are two different kinds of web development: a) Apps where the user is expected to stay a while b) Sites where the user is there, maybe once ever (most likely also scared off by the ads) For Apps, I would always prefer a pre-load of JS that was built with React and downloads about 2-4 MB. If there is an update I will be forced to download it again. On the UPSHOT, almost everything I do in that app is now a 3-8KB request. This means transitioning pages, changing states of things, all happen in about 50ms including whatever visual changes are required on the screen. Compare that to full-screen refresh apps and I am usually waiting 200-400ms. It just feels too damn slow. Why am I even typing this? This is the freaking whole point of an SPA. Are we not all caught up on this yet?
- deleted 8y ago[deleted]
- andrewmcwatters 8y agoThese definitions are a bit too narrow for me. I think there's a place for sites where the user is expected to stay a while, and where functionality doesn't warrant several megabytes of resources. Thinking that there's anything but can lead to a wasteful landscape for the web.
- mercer 8y agoIn those situations I'd generally recommend a conservative server-side approach...
- timr 8y agoUnless your user is sitting in the same datacenter as the app, there is almost no chance that you're getting a 50ms latency on any action that requires a round-trip. Pinging google.com from my current connection (NYC) results in an average 26ms latency. Facebook is 25ms. That's just baseline connection latency for a user in a place with a solid connection, and you're unlikely to do better. Realistically, most apps that aren't Google scale are lucky to get 300ms average latency. The way you improve responsiveness is by eliminating round-trips, not assuming that client-side frameworks will save you.
- colemannugent 8y agoOn a related note, does anyone have a good recommendation for a lightweight analytics solution? I've looked at Piwik/Matomo and it looks pretty good. I've also been looking at NGINX Amplify, but that is more web server metrics rather than "analytics" and it's SaaS of course. You'd think that there would be tons of NGINX plugins for stuff like this, but I haven't found any good self-hosted ones. I really would like to avoid running heavy JS on pages that are <10KB.
- ptx 8y agoSo how does the trick with the CSS-only expandable details view work?
- lbriner 8y agoSo everyone should optimize their web pages? That's not really news. The fact it happens demonstrates the real problems: lack of understanding of the people uploading the content, real financial needs from ad suppliers (Beggars can't be choosers), legacy software that won't be rewritten any time soon and a load of other issues. I don't think anyone disagrees with the theory, it's the reality we have to deal with.
- Animats 8y agoWhat's a good web design tool that doesn't put in all this crap? Blue Griffon?
- theandrewbailey 8y ago> The heaviest page, the marketing page, today weighs 110 KB with a cold cache, and 4.6 KB warm. (more comparisons between cold and warm loads) I set HTTP cache-control immutable on my blog's image/JS/CSS URLs this weekend. Cache-Control: immutable tells the browser that this URL will never change, so don't check to see if it has. It should cut down on the warm loads more. If it does change, the timestamp in the URL path will change, so browsers will check the new URL. https://bitsup.blogspot.com/2016/05/cache-control-immutable.html https://bitsup.blogspot.com/2016/05/cache-control-immutable.... I suggest caching the main HTML, too. It would get the total warm load down to less than 1 KB.
- redthrowaway 8y agoUnfortunately, the extent to which these sorts of guidelines will ever be followed is at most the extent to which programmers feel like putting in extra effort over and above that required to meet business requirements, and will usually require programmers to push back against business requirements in order to achieve any headway. Those little social buttons that track every user and nobody ever clicks? You're going to have to spend as much time making the case to your boss why they're a bad idea as you would simply implementing them. Ditto ad spam, interstitials, sticky banners, and the like. And if the UX is bad but conversions increase, good luck. These sorts of guidelines are great for small sites you control yourself. The chances of being able to follow them, even if you give a shit, on a corporate site where conversions put food on the table, is essentially nil.
- danmg 8y ago│ Today I turned off my ad blocker, enabled JavaScript, opened my network monitor, and │ clicked the first link on Hacker News - a New York Times article. It started by │ downloading a megabyte of data as it rendered the page over the course of eight full │ seconds. The page opens with an advertisement 281 pixels tall, placed before even the │ title of the article. As I scrolled down, more and more requests were made, | downloading a total of 2.8 MB of data with 748 HTTP | requests. That's why I do that in the background with a python script and inline the contents of the hn articles into an RSS feed [1] that I read on a terminal based client [2]. Source [3]. [1] https://damng.github.io/hackernews-rss-with-inlined-content/output.rss https://damng.github.io/hackernews-rss-with-inlined-content/... [2] https://codezen.org/canto-ng/ https://codezen.org/canto-ng/ [3] https://github.com/damng/hackernews-rss-with-inlined-content https://github.com/damng/hackernews-rss-with-inlined-content
- specialist 8y agoI just tried http://nytimes.com http://nytimes.com with both Lynx and Safari "in Lynx mode" (disabled JS, CSS, Images). Reminded me how much I miss gopher. Lynx's rendering was unusable, because their front page has all the nav, colophon, etc. cruft ahead of the content (in the DOM). Safari's rendering was almost usable. It still shows fancy typeface for the headmast, etc. Huh. Then I tried to disable custom fonts. I was amused to learn they're rendered with SVG, with no alt-text.
- danmg 8y agoyeah lynx needs a fork that uses dom-distiller to render things off screen, and then just uses its own renderer to show the final content.
- lcfcjs2 8y agoIn other words, go back to the 90s internet, what a shit article.
- mike22223333 8y agoHow do they make the money to keep the site up than. Server cost is like 5% of the expenses. Journalist salaries, writer salary all that full time salary, where do you get that from. No other business model exists.
- mike22223333 8y agoAnd if any exists, not enough people are ready to commit to it to make it a worthwhile investment.
- mike22223333 8y agoYour bill to isp does not pay the bill for my time and make me a profit. I need to make money, and if you have a problem with my business model, you can move on.
- hyperpape 8y agoNot a word about why any of this matters. I don't like the NYTimes website, but I like their reporting. If a ton of JavaScript is the price, I'll grudgingly take it. If there's a better way to pay, I'll gladly take that. But this article doesn't provide one, making it nothing more than navel-gazing.
- trolleyhacker 8y agoIt matters because you (generic you, not you specifically) don't pay my mobile bill.
- hyperpape 8y agoThen don't read their website. I'm entirely serious. If there's enough people like you, there's a good chance that it'll be noticed. I tend to think that websites are under-optimizing for responsiveness, though I confess that I don't have evidence for that claim. However, I also think that the kind of puritanism on display in this article requires an amount of work that would be a waste (again, no evidence).
- sixstringtheory 8y agoThe average NYT subscriber probably doesn’t understand these intricacies around how websites are built and delivered to their phones, or how network effects and scaling affect the infrastructure needed to do so. They also probably don’t care because they just signed onto the latest “unlimited” data plan with their service provider. So there probably aren’t enough people who understand the problem to make NYT notice (or care) due to boycotting. Regarding your last point: a waste for whom? AFAICT the only people benefitting from sticky/engaging services, highly instrumented frontends and downright dark patterns are the people extracting wealth, either directly from subscriptions (not so bad) or, in a much grander sense IMO, data brokers (bad, real bad).
- hyperpape 8y agoPeople notice when things are slow and annoying. They close the window and don't look at it. You might be right that not enough people will change their behavior to make a difference. And if so, tough luck. You and I aren't entitled to a news outlet that meets our latency requirements. We are entitled to complain on HN, but no one will really listen. Of course you also benefit via reading the news, having reporting on official corruption, and all that jazz. Contrary to your snark about wealth extraction, media outlets are typically losing money and cutting back on reporting. The NYTimes is in a better position than most, but in general, the problem is too little money, not too much.
- che_shirecat 8y ago> And if anyone at Google is reading, you should try recommending these strategies for speeding up pages instead of pushing self-serving faux standards like AMP. That's hardly fair, Google has been advocating the same web optimization techniques that were listed as part of their Google Lighthouse initiative. I know it's fun and trendy to hate FANG, but you could have got the same recommendations if you opened up Chrome dev console and went to the Audits tab.
- benlorenzetti 8y agoThis is a problem of economics more than design failure. The current legal/technical system that has developed between ISPs doesn't charge parties fractionally very well.
- commandlinefan 8y agoI still contend that silver-bullet-chasing is at the heart of a lot of web bloat. You have a "startup founder" (or fortune 500 middle-manager) who believes that he has a world-changing (or next-quarter revenue generating) idea, he just needs a couple of grubby programmers to type it into the computer for him. Now, he knows that these grubby computer geeks are far, far, beneath him, and that anything they know how to do must be trivially simple to do, he just didn't take the right classes in college to know which buttons to press to make the world-changing computer thing happen. So the programmers tell him it's going to take a few months. "A few months!" He explodes. "I need this by Thursday! I thought you worthless lot called yourself computer dwee- er, programmers!" So he casts them out of his sight and starts googling "how to program really fast". He comes across Angular. He doesn't know what "Angular" means, but google says it programs really fast, and google is smarters than those dorks who can't even make a website in two days. So he says, "here, use Angular, it makes things go really fast. This is the silver bullet we're searching for". Of course, Angular depends on a few MB of libraries - mostly because when somebody was creating a table controller or whatever the hell for Angular, he or somebody who had some sway over him told _him_ that these other dependencies would let him program real fast. And so on, down the line, until finally something bottoms out into some actual javascript that actually does something. But because making web pages load quickly and be pleasant to use and not choke the internet infrastructure is a "nice to have" but getting this world-changing thing "to market" is a matter of life and death, that nerdy sounding load-testing shit is pushed off until the very end until there's no time to do it and who cares because you can't stand the sight of those slovenly programmers any more anyway and if they knew what they were doing, they'd have gotten it right in the first place.
- meztec 8y agoIn addition to the technical concerns is the overall experience that is being designed that requires this type of implementation. This type of ad, popup, subscribe, video, etc... is ubiquitous across news/blogs.
- camgunz 8y agoThe Internet made copyable content essentially worthless, and we don't have an answer for it yet. If you really want to solve this problem (ultra-bloated web sites because of ad frameworks and what-not), you have to solve that, and it's pretty hard. Honestly, it's probably the case that the only way to really fix it is to nationalize it and fund it with taxes. Not ideal (conflict of interest, obviously), but it's probably better than not existing.
- jstewartmobile 8y agoI could write many awful things about the NYT. Misunderstanding the basics of web optimization would not be one of them. That website is an assault by design. And it looks like a lot of people don't really notice, or even mind, being assaulted by it. First world problems...
- luord 8y agoI remember when this was what progressive web development (enhancement was the term) was. I still don't quite understand how it changed into meaning web workers and all the caching and background process stuff.