[erlang-questions] Static files served through Webmachine

Tristan Sloughter tristan.sloughter@REDACTED
Tue Jul 19 05:24:20 CEST 2011

Yeah, I agree a 302 would probably be less efficient.

I'm not familiar with Rails doing .json/.html. My understand was Rails used
urls like I was wanting to use: domain.com/user/<user-id> -- no .html. Do
you mean something else where they use .json/.html?

Good question about caching servers as well.

On Mon, Jul 18, 2011 at 10:06 PM, Jack Moffitt <jack@REDACTED> wrote:

> > But my problem is wanting to be able have nice URLs like /user/user_id
> that
> > if its a request for text/html returns a file from /priv/user/show.html
> > while if its a request for application/json it returns the json
> Ah, I see the issue. I assume show.html is mostly empty and loads data
> from the json file? I'm not sure if nginx's matchers are sophisticated
> enough to route by content requested. You could return a 302 from
> webmachine, but this is probably going to make it less efficient than
> just dumping the file from memory.
> If you're willing to use the Rails-type .json/.html format stuff on
> the ends of your URLs, this becomes easy.
> Now you've made me curious whether web caching servers are smart
> enough to distinguish by content type as well.
> jack.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110718/a2cc8e55/attachment.htm>

More information about the erlang-questions mailing list