Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How to write imageboard

Name: Anonymous 2010-08-28 20:32

Hello,
I found out that kusaba x is pretty old shit. What's this whole think about generating html files? Can't it be done simply by sql queries every time and do it with some ajax? How would you write it?

Name: Anonymous 2010-08-28 21:57

There's a very good reason why the high-traffic boards all generate html at post time. The content is going to be exactly the same every single time the page is fetched, and reads happen much more often than writes. The way imageboards are structured makes it dead simple to offload the page-serving to a fully static server on a different subdomain than where the form submissions are handled. Static content can be served significantly faster than dynamic content,[1] this makes for a major reduction in server load and allows for many more page views on modest hardware, lessening the budget for running the website.

Now, most Shitsaba installations are used by about ten people, so this is all irrelevant in those cases, but for larger boards such as 4chan, generating pages ahead of time makes a tremendous difference, and removes the need for typically flaky and awkward (and overly ENTERPRISE) "solutions" such as stuffing a caching proxy in front of the server. If the affected files are simply regenerated when they're changed, there's no need to constantly fuss with revalidating or invalidating the cached copies, and the problem of multiple requests causing simultaneous cache misses never even occurs.

References
1. http://arnisoft.com/239/server-benchmark-apache-nginx-cherokee/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List