Consultation request: feed local folder across rails (or not?)
Objective: serve files located in a local folder on the server to clients via http / 80. Eventually, I plan on emulating the folder on the client, but that doesn't address my question.
So, this server has an existing Rails application (rest based / xml) that clients will use in conjunction with these files.
I don't need any logic for the files being uploaded or uploaded, so I ask myself:
- Do I need to involve a Rails application to work with these files?
- Shouldn't the web server handle communication between local files and clients?
- Will this new Rails Metal or Rack integration be part of the solution? (not familiar with any)
I think http over port 80 is more important here.
Thanks for any guidance or advice on this matter, cheers, Max
I know that with a good investment of time I could watch it all for a couple of hours and figure it out, but I'm very busy, which saves a lot of time.
a source to share
you can use X-Sendfile if using Apache or Lighty (see this blog post). Nginx supports X-Accel-Redirect . Both of these approaches will allow your webserver to send the file directly without involving your rails app.
a source to share