Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An additional requests for html isn’t slow, and now I have to have a whole “build” process for something that is basically static. Not ideal


By "whole 'build' process", do you think something like a makefile or do you think something more advanced is required?

One drawback though would be that one indeed would have to maintain dependencies, which would be error prone beyond simply adding headers and footers... I wonder if one could (ab)use CPP [1] and its -M option to do that.

[1] https://gcc.gnu.org/onlinedocs/cpp/Invocation.html


Well, that very much depends on your definition of slow, doesn't it?

An additional request is another round trip. That can be very slow. Average TTFB on the internet in the US is ~0.7 seconds.

It's much faster to send it as part of the same request as you then don't have to wait for the browser to discover it, request it, wait for the response and then add it.

A build process does not have to be complicated, at all. If you can write HTML then using something that can simply read the HTML includes you wish existed and swap it with the specified filename is trivial.

Ofc, the idea has many other issues, like how to handle dependencies of the included HTML, how to handle conflicts, what oath to use and many more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: