4 ms·
Then the server should supply the right format based on the `Accept` header, be it `application/rss+xml` or `application/atom+xml` or `text/xml` or `text/html`.
by shadowgovt 11mo ago
Then the server should supply the right format based on the `Accept` header, be it `application/rss+xml` or `application/atom+xml` or `text/xml` or `text/html`.
Even cheaper than shipping the client an XML and an XSLT is just shipping them the HTML the XSLT would output in the first place.
- kuschku 11mo agoThat's not exactly cheap on an arduino uno 3 with 2kb ram. But regardless, someone suggested just including a script tag with xmlns of xhtml as alternative, which should work well enough (though not ideal).
- ErroneousBosh 11mo agoHow many people out of the world's nearly eight billion population, would you estimate, are attempting to host their blog including HTML posts and RSS feeds on an Arduino?
- kuschku 11mo agoA lot of IoT devices use this strategy, actually. A lot. Significantly more than are using e.g. WebUSB. Nonetheless, by that same argument you could just kill HN off. A lot of projects have a benefit that far outweighs their raw usage numbers.
- ErroneousBosh 11mo agoI guess that tracks for Internet of Shitty Insecure Badly-Designed Things. Come up with the worst possible way to present information over a web page. What device with 2kB of RAM is going to generate any kind of useful RSS feed? Why would you not use something more capable, which is not only going to have more memory but also a lower power consumption?
- kuschku 11mo ago> What device with 2kB of RAM is going to generate any kind of useful RSS feed? Such devices usually don't generate RSS feeds, but e.g. sensor measurements as XML (which can be processed directly, or opened in a browser with XSLT to generate a website and an SVG chart from it) > Why would you not use something more capable, which is not only going to have more memory but also a lower power consumption? Because anything else will have >100× more power consumption?
- ErroneousBosh 11mo agoCompare the power consumption of the atmega328p on an Arduino Uno 3 mentioned further up this thread, with the power consumption of literally any ARM chip smaller than the sort of thing you'd use in a laptop.
- James_K 11mo agoSo in other words, no more static sites?
- shadowgovt 11mo agoA static site can inspect headers. Static sites still have a web server.
- James_K 11mo agoA static site cannot inspect headers. There is no HTML, or even JavaScript function you can put in a file to inspect the headers before the file is sent to the client. A static site is a collection of static files. It doesn't need a server, you could just open it locally (in browsers that don't block file:// URI schemes). If you need some special configuration of the server, it is no longer a static site. The server is dynamically selecting which content is served.
- shadowgovt 11mo agoOh, difference in definitions. You mean "non-configurable web server." Because you could definitely use a static site generator to create multiple versions of the site data and then configure your web server to select which data is emitted. But agreed; if your web server is just reflecting the filesystem, add this to the pile of "things that are hard with that kind of web server." But perhaps worth noting: even Apache and Python's http.server can select the file to emit based on the Accept header.
- James_K 11mo agoA static site is one that you can serve through static hosting, where you have no control over the web server or its configuration. There is not some extra thing which is a static site with dynamic content. “Static” means “doesn't change.” The document served doesn't change subject to the person receiving it. You are talking about a solution that is dynamic. That does change based on who is making the request. >you could definitely use a static site generator to create multiple versions of the site data and then configure your web server to select which data is emitted And this web-server configuration would not exist within the static site. The static site generator could not output it, therefore it is not a part of the static site. It is not contained within the files output by the static site generator. It is additional dynamic content added by the web server. It breaks the fundamental aspect of a static site, that it can be deployed simply to any service without change to the content. Just upload a zip file, and you are done.