eThreads: the need for speed
Posted Saturday, November 27, 2004, at 12:02AM by e;
I just put a new eThreads snapshot in place, so hopefully things will feel a little faster here. I'm valuing speed over a small memory footprint, so I added a cache in memory. I also rewrote the way internal links work (links within the blog... all URLs stay the same) to do some stuff I couldn't do without good speed.
Most of what I did wouldn't make any sense to anyone but me, but here's the kind of cool stuff the new link structure does: the template being linked to determines what the link looks like. A simple example: From the main page I link post titles to the permanent URL for the post. In the template code on the main page there's this little snippet:
{link "/blog"}{qopt "id"}{$p.id/}{/qopt}{/link}
That tells the link code that we're linking to the /blog template. It then loads up that template and makes sure "id" is an option /blog's looking for. At that point it knows it can link to /blog?id=$id. But it also looks at the /blog template's keys, and sees that it has id defined as a key. That means that it can link a cleaner URL as /blog/$id. That's the one it uses.
Now I just have to keep an eye on memory usage and figure out how best to expire things out of the cache. Fun fun fun.
Comments —
Add Your Comment —
Eric Richardson lives in Los Angeles, California, and is generally trying to figure out the future of community news. He is the publisher of blogdowntown, an online news site for Downtown Los Angeles.
Over on blogdowntown:
Recent Comments:
- Littlebighuman on Why Can't Open Office...
- 0xentrot on Building a Phone System...
- Some guy answering a really old question on Why Can't Open Office...
- openoffice user on Why Can't Open Office...
- e; on The Phone is Ringing
- kda406 on The Phone is Ringing
- Jeff Phillips on The Phone is Ringing
- David (Australia) on The Phone is Ringing
- frank on Why Can't Open Office...
- Dave on The Phone is Ringing
On This Date
- 2005
- The Joy of Good Drivers
- Midnight Ridazz: The Heavy Metal Ride
- 2003
- Post #100 of 2003
- 2000
- dream

Recent Comments: