Live data from Hacker News

CPP: A Standardized Alternative to AMP

timkadlec.com

21–30 of 97 posts

Re: CPP: A Standardized Alternative to AMP

#21
post #3

Just use pure HTML/CSS and the web sites will fly by comparison.

HTML/CSS are slow. The true way is ".txt" Edit: I mean this as a sort of lazy way of making a reductio. I don't think .txt is better than HTML/CSS for pages (and I hope that's obvious). I also don't think having no JS is a good idea. I believe in progressive enhancement, and to a first approximation, I think that all websites have at least one feature that they could implement in JS that would be "a good thing".

Whoa whoa whoa, what's some fat cat solution right there! Just use a http header for your content and you're set.

Re: CPP: A Standardized Alternative to AMP

#22

Earlier quoted context omitted.

HTML/CSS are slow. The true way is ".txt" Edit: I mean this as a sort of lazy way of making a reductio. I don't think .txt is better than HTML/CSS for pages (and I hope that's obvious). I also don't think having no JS is a good idea. I believe in progressive enhancement, and to a first approximation, I think that all websites have at least one feature that they could implement in JS that would be "a good thing".

Whoa whoa whoa, what's some fat cat solution right there! Just use a http header for your content and you're set.

The url should contain all the information so we don't have to make a HTTP request.

Re: CPP: A Standardized Alternative to AMP

#23
post #16
post #3

Just use pure HTML/CSS and the web sites will fly by comparison.

For a single page load, sure. For subsequent page loads you're loading a lot more than necessary (a JS app can fetch just the content that's changed, and without a blank page in between), so a pure HTML and CSS solution is a great deal slower. Plus, if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline, and only load in new content when possib…

There is a thing in HTML5 called Subresource Integrity (https://developer.mozilla.org/en-US/docs/Web/Security/Subres...).

It looks like this:

  
I wonder if browsers could keep a cache with those hashes as keys and whenever the integrity hash has a match, then it can take the JS from the cache. That would save huge amounts of bandwidth and pages would be so much faster to load.

Probably right now we're fetching the same version of jquery hundred of times from 20 different domains a day.

Re: CPP: A Standardized Alternative to AMP

#25
post #15

Earlier quoted context omitted.

I agree 90% with this; .txt files get most of the job done! ;-) The other 10% where i don't fully agree comprises of hyperlinks; i need me some clickable hyperlinks. :-)

Browser option to make hyperlinks clickable when rendering text files? Or client-side browser rendering of text-based markdown.

Having browsers intelligently render `text/markdown` sounds like a great idea. And while we're waiting on the browser implementation, maybe we can find some sort of temporary workaround to send a markdown parser to the client?

Re: CPP: A Standardized Alternative to AMP

#26
post #16
post #3

Just use pure HTML/CSS and the web sites will fly by comparison.

For a single page load, sure. For subsequent page loads you're loading a lot more than necessary (a JS app can fetch just the content that's changed, and without a blank page in between), so a pure HTML and CSS solution is a great deal slower. Plus, if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline, and only load in new content when possib…

Given my web development scars, I have become an advocate that for anything other than dynamic documents, the way to go is native.

Re: CPP: A Standardized Alternative to AMP

#27
post #23
post #16

Earlier quoted context omitted.

For a single page load, sure. For subsequent page loads you're loading a lot more than necessary (a JS app can fetch just the content that's changed, and without a blank page in between), so a pure HTML and CSS solution is a great deal slower. Plus, if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline, and only load in new content when possib…

There is a thing in HTML5 called Subresource Integrity ( https://developer.mozilla.org/en-US/docs/Web/Security/Subres... ). It looks like this: I wonder if browsers could keep a cache with those hashes as keys and whenever the integrity hash has a match, then it can take the JS from the cache. That would save huge amounts of bandwidth and pages would be so much faster to load. Probably right now we're fetching the sa…

> There is a thing in HTML5 called Subresource Integrity

It piqued my interest, but I was disappointed to discover that it's only supported by Gecko & Blink[1] - not supported by Safari or IE/Edge. Javascript is currently unavoidable for offline apps.

1. http://caniuse.com/#search=integrity

Re: CPP: A Standardized Alternative to AMP

#28
post #23
post #16

Earlier quoted context omitted.

For a single page load, sure. For subsequent page loads you're loading a lot more than necessary (a JS app can fetch just the content that's changed, and without a blank page in between), so a pure HTML and CSS solution is a great deal slower. Plus, if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline, and only load in new content when possib…

There is a thing in HTML5 called Subresource Integrity ( https://developer.mozilla.org/en-US/docs/Web/Security/Subres... ). It looks like this: I wonder if browsers could keep a cache with those hashes as keys and whenever the integrity hash has a match, then it can take the JS from the cache. That would save huge amounts of bandwidth and pages would be so much faster to load. Probably right now we're fetching the sa…

Currently, SRI is not enough for browsers to implement content-addressable storage as you describe here, because it is subject to cache poisoning. See https://news.ycombinator.com/item?id=10311020 - basically, the browser can't know if a script can actually be loaded from the claimed domain without requesting it. This can be used to violate CSP.

Though it would be nice for the browser to cache it for domains that have delivered the script previously. It wouldn't be that different from a normal cache except the timestamp doesn't matter.

Re: CPP: A Standardized Alternative to AMP

#29
post #16
post #3

Just use pure HTML/CSS and the web sites will fly by comparison.

For a single page load, sure. For subsequent page loads you're loading a lot more than necessary (a JS app can fetch just the content that's changed, and without a blank page in between), so a pure HTML and CSS solution is a great deal slower. Plus, if you users have unreliable internet connections then a JS app can use a service worker to cache the entire app to work offline, and only load in new content when possib…

pjax (whether using the old familiar jquery-pjax or some more up-to-date implementation) is great for decorating simple HTML pages with, to replace full page loads with just a main-content load. And since the fall-back is just a full page load, it degrades really gracefully.
Post reply on HN