rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Magnus Holm <judofyr@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Middleware for serving static files
Date: Tue, 20 Dec 2011 10:07:44 +0100	[thread overview]
Message-ID: <CAJ367fdgAoFUC3upSHU1Kw=MG0K3VoHjVY7so3cAE-OgaAW3Lg@mail.gmail.com> (raw)
In-Reply-To: <EA21EDF7C40C47988CFA1BABAE799D2F@gmail.com>

On Tue, Dec 20, 2011 at 09:52, Lee Hambley <lee.hambley@gmail.com> wrote:
> Magnus, Rack does, it's Rack::Static… I can't think of a good reason not to
> have a directory like `/s/` to store those assets. Otherwise how should Rack
> know which URLs to route to where? The only information it has is from the
> URL that is requested, and some environmental headers.

Rack::Cascade + Rack::File solves this just fine.

> You'd be well served to consider how you'll solve this problem in
> production, letting your ruby stack serve static files is going to be a
> performance disaster, that's an unspoken rule we all know about, so even
> when you get into production, you're going to need a way to configure
> Apache/Passenger/nginx/unicorn/rainbows to serve these assets,

Yes, in production I'm using Nginx to serve the static, but what about
development?

> and again the
> way will probably be based on a URL filter which will serve assets directly,
> and not proxy them to your application's backend.

Ehm, no? Both Nginx and Apache will serve static files if they exist
in the document root, and proxy to the application backend otherwise.
I just want to mirror this setup in development.

> Final note, I think we're taking the list off-topic, the list is intended
> for Rack developers to discuss and announce changes; I've never seen a
> support thread here, and would recommend stack overflow.

Again: This isn't about solving my problem, it's about making Rack
solve this problem.

  reply	other threads:[~2011-12-20  9:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  8:32 Middleware for serving static files Magnus Holm
2011-12-20  8:41 ` Lee Hambley
2011-12-20  8:45   ` Magnus Holm
2011-12-20  8:52     ` Lee Hambley
2011-12-20  9:07       ` Magnus Holm [this message]
2011-12-21  2:49         ` James Tucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ367fdgAoFUC3upSHU1Kw=MG0K3VoHjVY7so3cAE-OgaAW3Lg@mail.gmail.com' \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).