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

Better implementation

Name: Anonymous 2012-08-30 15:07

Ok, first time I post here.
I want to write down my own imageboard program, just for the heck of it, and I am in a dilemma.
The way I had thought of it, I would have a single "content" file, that would be dynamic, and all the content would be generated within it.
However when I looked into futallaby for reference, the way they do it, is that there is no main "content" page, all pages are genereted within the script but are then dumped and delivered as static  html pages.
So, I want to axe you this question:
>Which way do you think its a better implementation?

>OP is a faggot

Name: Anonymous 2012-08-30 17:26

>>13
Yeah, that's all right and good. Generating dynamically for every request is never a great idea. Generating new static pages for every post is much faster, but it seems wasteful to me.

Say you don't prune threads and eventually you have 50+ pages. The last page changes with every post, but nobody ever looks at it. For every revision of the last page anyone ever sees, you've generated maybe hundreds of them.

memcached let's you save a generated page in memory. It works like this:
* anon 1 visits page 1
* page 1 is not cached, so page 1 is generated and cached
* anon 2 visits page 1
* page 1 is cache so the cache is loaded
* anon 1 posts to thread 1
* the cache for thread 1 is cleared
* because thread 1 is on page 1, cache for page 1 is cleared
* anon 1 is redirected to thread 1
* thread 1 is not in the cache, so thread 1 is generated and cached
* anon 2 visit thread 1
* thread 1 is cached so cache is loaded
* anon 1 goes back to page 1
* page 1 is not cached so it's generated and cached

And so on. The more visitors you have the less cache misses.

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