Live data from Hacker News

CPP: A Standardized Alternative to AMP

timkadlec.com

51–60 of 97 posts

Re: CPP: A Standardized Alternative to AMP

#51
> No synchronous external scripts nor blocking external stylesheets

I know we have:

but for stylesheets, why can't we have something similar? Instead of a JS workaround, can't we have:

I hate hate HATE the idea of having css dependent on some JS (even if enabled) that might or might not run depending on what feels like working today.

Re: CPP: A Standardized Alternative to AMP

#52
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…

At least on HTTP/1 sites, most people are bundling their libraries together, so subresource integrity can't save you there.

I want to say there's a security concern with re-using these libraries, but I guess the possibility of a hash collision would be extremely small.

Re: CPP: A Standardized Alternative to AMP

#53
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…

All that stuff sounds really great if you had a lot of engineering resources and you are writing Gmail, but for 99% of the sites out there the JS hacks that load just the deltas and whatnot just get confused by packet loss and I end up having to reload the entire page including the gigantic JS hairball, or even worse the thing is so confused that I have to clear my cache and cookies to make it ever work again.

Simplicity has so many things in its favor.

Re: CPP: A Standardized Alternative to AMP

#54
post #49

Earlier quoted context omitted.

If you can always find what you’re looking for for any non-trivial (2 keywords or more) search terms, how is it not a minor collision? “CPP” is not even the name of the language—it’s the file extension. EDIT: Mostly I’m just annoyed that those useless off-topics about naming keep crowding out actual discussion.

But CPP is the name of the language! https://en.wikipedia.org/wiki/C_preprocessor

You are contradicted by literally the first sentence in that article.

Re: CPP: A Standardized Alternative to AMP

#55

Someone posted this in a reply the other day and I feel it should go here as well: https://vimeo.com/147806338 It's a pretty interesting talk. Just thinking about this kind of stuff can make way skinnier web pages than AMP. I mean really, if we designed pages for 56k modems, the web would be much much fast on mobile.

I would just about give my left arm for a consistent 56k mobile connection.

Re: CPP: A Standardized Alternative to AMP

#56
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…

They won't unfortunately implement that caching scheme, because that leaks the sites you have visited to attackers.

Re: CPP: A Standardized Alternative to AMP

#57

Isn't there a better alternative to an abbreviation that's already widely used in the software engineering context?

PPC is pay per click, which is more likely to create confusion in a web dev context. PCP is less widely used in a software engineering and web developer context (one hopes anyway), but probably not something you want to be searching for from a work computer.

If we could get away from policies though, Performant Content Contracts doesn't overlap with much that is CS related.

Re: CPP: A Standardized Alternative to AMP

#59
post #4

This was first published last February, and the top comment was from a Googler who's involved with the AMP project: > Love this. Not sure by coincidence, but the AMP team has been playing around with the same thing under literally the same name. We should meet up some time and discuss details. Not sure it would be an alternative, but rather a complementary thing. I wonder what ever came of that.

Correct me if I'm wrong, but doesn't the content maker get to decide if they in fact do want all the AMP benefits or not? If I remember correctly you can choose to disable the whole AMP cache google link, and only use the AMP optimizations.

Secondly, He goes on for a few paragraph at the start about how anyone can do this, but that's not so true is it? The whole point of the AMP redirect is that it's on Google cache servers, and unless you have a lot of money, that ain't gonna be cheap.

So at the end of the day, the last part is optional, and it's basically you paying for the cache with allowing them to use their domain (will all ads and traffic stats still sent to you).

Re: CPP: A Standardized Alternative to AMP

#60
I think the real concern about AMP is not that it's nonstandard, but that Google's caching mechanism reduces publishers' control over how their content is presented and keeps users on Google's domain. This is a problem for publishers, but I assume it increases performance (perhaps because Google prefetches the page while the user is looking at search results?).
Post reply on HN