Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

pre / next vars - great but HUGE compile times...


I'm very happy w/ Citydesk 2.0 BUT, was hoping someone might have a work-around for a production problem I'm running into.

My site is a blog and I wanted to use $nextLink and $previousLink on each article to link to adjacent articles.

However, this introduces a dynamic element to every article which means when I hit the "publish" button CD2.0 has to iterate over practically the entire database....  this takes a LONG time...

Any ideas???

vinod v
Tuesday, August 26, 2003

Have a cop of (something) while you wait. ;-)

Jorgen Brenting
Wednesday, August 27, 2003


yes this seems to be a problem. A developer myself I suspect this is not an easy problem to solve because of the kind of software CD is. It is a desktop application which has to recreate everything that changes every time a small change has been made. The only solution I can think of is use a snippet of PHP (or similiar) to do this kind of thing on the server not the desktop. Personally I think I wouldn't use it on something like a huge blog. I am going to license it anyway, but for creating sites with a small number of pages (5-50)

Sasa Velickovic
Wednesday, August 27, 2003

FWIW, one work around I used for a somewhat-similar feature was to use a javascript include to pull in a separately compiled, single article....

in this case, on my blog -- -- I keep a list of "recent articles" along the left hand side.  This is compiled by CD once into a single single file and then composited on the client side when it downloads the article.....    as a result, old articles never need to change and CD only has to continually recompile a single article....

this doesn't work here since the object that gets recompiled (the prev / next links) need to vary on a per-article basis....

vinod v
Wednesday, August 27, 2003

The compute time for the approach they're using scales as the square of the number of articles in the list of articles designated as the argument of the next and prev operators. That makes the feature useful only for small sites.

I tried adding next/prev links to my site, and didn't even wait through a single publish to see how long it would take; I estimate it would have taken at least 25 minutes to fully publish my site. (I was complaining before because it was taking 45 seconds.) But that's because I have about 1800 articles in my database, with each of them trying to create a next link and a prev link.

For each of those, CityDesk first had to create the entire list of about 1800 articles sorted by my criteria, then locate the current article in that list, and then determine which the next would be. And then do it all again for the prev link.

So 3600 times (twice for each article) it had to create the exact same list of 1800 articles in the exact same sort order, which is a fearsome amount of redundant work.

Steven Den Beste
Friday, August 29, 2003

Per my comment here:

This is another case of messy script build-up. In chronological articles for example, the next and previous links only need to be put on a page once. So for Steve it would be nice to tell the script to "Do your 25 minute thing, put the results in the articles where they belong, and get out of here. From now own just put the next/previous on my new pages."

Friday, August 29, 2003

*  Recent Topics

*  Fog Creek Home