Say hello to Lighttpd

Posted by Damien Pollet Thu, 08 Sep 2005 01:06:46 GMT

lighttpd logo … and bye to Apache 2!

I just switched my web server to Lighttpd. The configuration file was quite easy to write without too much RTFMing besides the docs on the Rails wiki.

Disclaimer: This is just quickly tested so it’s probably broken in some way… anyway, we’ll see :-)

Update: I’ve also upgraded typo to get the latest stuff from SVN. Had to migrate my development database by hand (SQlite migrations will be in the next Rails release) and to update all the posts to add tags and clean the categories. And in the process I think I blacklisted myself from technorati by pinging them a little too much during the last hour… oh well :-)

Posted in  | Tags , ,  | no comments

Typo 2.5 is out!

Posted by Damien Pollet Fri, 05 Aug 2005 20:22:51 GMT

Tobias just released Typo 2.5! You can get it from the wiki or on rubyforge. If you want to see what it looks like, Justin wrote a review of the changes with many screenshots of the new admin interface.

I’m quite proud of this because that’s the first time I contribute real stuff to an open-source project — parts of the static caching system — but Scott is probably the one to blame for more than doubling the number of changesets since the last release :-)

Posted in  | Tags ,  | 1 comment

Typo tweaking

Posted by Damien Pollet Fri, 15 Jul 2005 21:42:00 GMT

I’m in the process of reapplying my caching modifications to the latest typo code, so don’t panic if things get a little strange this weekend.

Update

I finally got the thing working again, and committed in a separate SVK branch. Makes it easy to test stuff on one machine and apply changes on the server later.

Pages are now cached more or less correctly (there is a little kludge for the .../pageN route to work) but once they are cached, they stay so. It’s hard to invalidate a cache when you don’t know what’s here to be invalidated…

Update 2

Yet another update to synchronize with Tobi’s changes.

Pages are now uncached! There is still some little glitches, but they should be easily fixed ;-)

Update 3

Whoops, it seems I’m now officially a contributor to typo…

Posted in ,  | Tags ,  | 1 comment

Attempts at Typo caching

Posted by Damien Pollet Sun, 12 Jun 2005 12:41:00 GMT

Yesterday I tried to get typo to generate static versions of the main pages to improve the speed. I’m running it on a Sun workstation I got for 10 euros, so ruby is not exactly zippy :-)

The first problem is with pagination: the page number is passed as a parameter in the URL, so I added the following route:

map.connect 'articles/page/:page', :controller => 'articles',
  :action => 'index', :page => /\d+/

With this route, page 2 gets cached in public/articles/page/2.html for instance. Which is a problem since the links don’t include the .html extension. Second problem is the main page, which gets cached as public/index.html but since it’s accessed by the root URL, rails serves it even when the cache is here. I tried to tweak how apache rewrites the URL, without success:

RewriteRule ^/$ /index.html [R=301]

# or, later:
RewriteCond index.html -f
RewriteRule ^/$ /index.html [L]

Next problem will be to update the aggregated feeds in the side bar, even when rails is completely bypassed by the cached page ; a good place to add some ajax goodness, but I guess I have to RTFM a little more about routes and mod_rewrite before that :-)

Update

It seems I got the routes to work… the rewriting rules are now:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]

… which happens to be the default. duh.

I’ll have to fix the “posted by whom that many days ago” subtitle, and check that cached pages are correctly invalidated. There is still the RTFM’ing part to do, because there’s some rails routing magic I don’t really understand yet.

Update 2

Had some problems with cache sweeping but it works now; it’s probably a little zealous, but it’s here. It’s still broken for the pagination links at the bottom, though… I have to find how to cleanly recompute the page number to sweep, or how to sweep all pages at once (e.g. find how much pages there are in total).

Update 3

The javascript trick to display post dates works now, so I sent my changes.

Posted in ,  | Tags , , ,  | 5 comments