Live data from Hacker News

Build Static Websites

eager.io

31–40 of 60 posts

Re: Build Static Websites

#31
post #19

Static website generators seem to come and go -- would anyone like to comment on one they like that seems to be lasting the test of time? The obvious one seems to be jekyll (possibly with octopress on top of it), but I'm interested in any others.

I don't know about "lasting the test of time", but I recently used Hugo (Jekyll clone written in Go) and found it impressive. http://gohugo.io/

I second that. The templating is a bit tough to get my head around, not being proficient in Go, but super-fast times to generate the static content.

Re: Build Static Websites

#32
post #2

How do plugins like WP Super Cache https://wordpress.org/plugins/wp-super-cache/ compare with straight HTML pages? The extra overhead is in the PHP serving up the cached HTML page, but how effective is it in comparison? More of the static site development setups don't have an admin system that compares with WP, is there a WP plugin to export to a static site? Edit: WP caching benchmarks http://cd34.com/blog/scalabili…

> is there a WP plugin to export to a static site?

I came across this a little while ago: https://decoupled.de/

Re: Build Static Websites

#33
I tried building a static website for people to browse tech article headlines that were gather ed from around the web. The feedback was that people like the style and general idea, but wanted a crap ton of features that can only be accomplished in a highly dynamic and scalable web site. IE Logins, Voting, Commenting, Friending, Favoriting, Etc and so forth.

Re: Build Static Websites

#34
post #10
post #6

Absolutely, take static as far as you possibly can. In a world with S3 and Cloudfront, there is really no reason for a static site to ever be down. This is great for a company's marketing focused web presence. But often the reason you're getting all those visitors to your site in the first place is that it does something valuable that requires data persistence, which usually implies user sessions, which implies authe…

Just to take it a step further though, in a world where every browser can run Javascript and make AJAX requests, which of your requirements can't be handled by the client communicating with an API directly? Considering sessions for example, local storage is supported by virtually every browser you can name: http://caniuse.com/#feat=namevalue-storage In my experience, it's significantly easier to scale an API than a t…

I don't disagree at all, but scaling a dynamic API is still harder than scaling static resources. Saying "we're doing everything through an API" is one solution to the problem of scaling the dynamic portions of the application, which I alluded to.

Something of an aside: You really don't need localStorage to do this. You can still use cookies, you just can't use HttpOnly cookies, and in fact that's what the localStorage polyfills I've used fall back to. The trade-off (drat! there's always one of those) of both localStorage and non-HttpOnly cookies is that it once again becomes easy to steal user access credentials outright if you can manage an XSS attack, which is what HttpOnly cookies helped prevent in theory. On the other hand, in practice XSS attacks can still usually steal an account even with HttpOnly cookies (for instance, by sending a request to change a user's password, which dutifully sends along the valid cookie anyway) or do other nefarious things, so you just can't let XSS happen either way.

Another question is: Is the user experience of applications built this way as good? It definitely can be once everything is loaded and churning along, but the initial load can be quite slow and choppy as data comes back piecemeal. Server-rendering the initial page and doing updates through an API is, I believe, the way forward, but it's still tricky and inconvenient to do. And then you once again need to scale the rendering of full pages server-side!

tl;dr; Yes, that's a good approach, but not a panacea.

Re: Build Static Websites

#36

I've been trying this philosophy out on a little GitHub Pages editor app [1]. Everything happens client side apart from a tiny bit of OAuth handled by heroku! 1: http://github.com/iamdanfox/ghupdate/

[deleted]

Re: Build Static Websites

#37
Another solution we implemented was to have a WordPress site up, but only serving a spidered copied HTML version of it in the public_html directory.

Every 2 minutes the site gets fully spidered, dumped into flat HTML files. And if the dump is not successful, because of a database connection or any problem at all, it doesn't get saved and doesn't overwrite the public_html dir.

Re: Build Static Websites

#38

I tried building a static website for people to browse tech article headlines that were gather ed from around the web. The feedback was that people like the style and general idea, but wanted a crap ton of features that can only be accomplished in a highly dynamic and scalable web site. IE Logins, Voting, Commenting, Friending, Favoriting, Etc and so forth.

A lot of that stuff can be done with embedded third-parties like Disqus or ShareThis.

Re: Build Static Websites

#39
Working for a web firm that has a CMS, and web platform that is 95% ran from SQL queries. Reading this reminds me how cluttered and loaded websites have become. Granted I'm not a developer, but it's noticeable when you have to account for 1.5 seconds of latency because of database pulls, and the fact that it makes everything more complicated, as well as harder to design for resiliency.

Re: Build Static Websites

#40

Static website generators seem to come and go -- would anyone like to comment on one they like that seems to be lasting the test of time? The obvious one seems to be jekyll (possibly with octopress on top of it), but I'm interested in any others.

Middleman still receives consistent updates. It's been a rock solid platform for us to build static websites and the occasional prototype out of for the last few years. Deploys easily to GitHub pages, too.

https://middlemanapp.com https://github.com/middleman/middleman

Post reply on HN