From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: Serving files with guile web server Date: Sat, 19 Mar 2011 02:20:47 +0000 Message-ID: <874o6z97gg.fsf@ossau.uklinux.net> References: <9838.187.147.43.113.1300318403.squirrel@lavabit.com> <58164.187.147.43.113.1300373729.squirrel@lavabit.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300501325 4575 80.91.229.12 (19 Mar 2011 02:22:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2011 02:22:05 +0000 (UTC) Cc: guile-user@gnu.org To: romel@lavabit.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Mar 19 03:21:58 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0lnh-0004v3-2m for guile-user@m.gmane.org; Sat, 19 Mar 2011 03:21:57 +0100 Original-Received: from localhost ([127.0.0.1]:51829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0lnN-0006qi-V7 for guile-user@m.gmane.org; Fri, 18 Mar 2011 22:21:37 -0400 Original-Received: from [140.186.70.92] (port=51915 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0lnJ-0006q5-Rx for guile-user@gnu.org; Fri, 18 Mar 2011 22:21:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0lnI-0006KL-6D for guile-user@gnu.org; Fri, 18 Mar 2011 22:21:33 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:44016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0lnI-0006Gq-1g for guile-user@gnu.org; Fri, 18 Mar 2011 22:21:32 -0400 Original-Received: from arudy (unknown [78.149.206.140]) by mail3.uklinux.net (Postfix) with ESMTP id 861541F6697; Sat, 19 Mar 2011 02:20:49 +0000 (GMT) Original-Received: from neil-laptop (neil-laptop [192.168.11.7]) by arudy (Postfix) with ESMTP id 91B5738013; Sat, 19 Mar 2011 02:20:47 +0000 (GMT) In-Reply-To: <58164.187.147.43.113.1300373729.squirrel@lavabit.com> (romel@lavabit.com's message of "Thu, 17 Mar 2011 10:55:29 -0400 (EDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 80.84.72.33 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8543 Archived-At: romel@lavabit.com writes: > I gave a second read to the manual and found: > > "The handler should return two values: the response, as a > record from (web response), and the response body as a string, bytevector, > or #f if not present." > > If this is correct then I guess I should check the file type first and > then read the file to either create a string or a bytevector from it. > > Any recommendation will be highly appreciated. Well, I suppose I'd recommend considering not using the Guile server to serve static files. Using Guile makes more sense when you want to generate dynamic content, because then you're really using the capabilities of the language. In my web server experiments so far I've used Apache, modlisp and Guile together, and this combination seems to work well. Then Apache can handle all the static content (I guess using the efficient sendfile) without bothering modlisp or Guile, but dynamic stuff can be routed via modlisp to Guile. Regards, Neil