0

I want to deploy an app using Sinatra on Phusion Passenger w/ nginx. If I want to set the Expires header on my static content - stylesheets, say - there are appear to be three places where I could accomplish this.

  1. In my Sinatra app, using the API
  2. With Rack middleware
  3. In the server config for my deployment

Which of these methods is the best place for setting HTTP headers?

dbrown0708
  • 4,544
  • 4
  • 25
  • 22
  • I'm not asking how. I'm asking which. – dbrown0708 Feb 03 '10 at 03:48
  • 1
    Just curious, why is your static content going through the app layer at all? Shouldn't it get handled by Apache/lighty/whichever? – Josh Lee Feb 04 '10 at 09:18
  • That's correct. I've come to realize that option #1 really isn't an option in production after all. I guess that means that option #2 isn't an option either! – dbrown0708 Feb 04 '10 at 11:25

1 Answers1

1

After talking though and answering this question and seeing the comment above, I think I have figured out the answer to my own question.

The whole point of nginx actually removes the first two options.

That leads to Option #3. This is where all the other content config is set, such as gzip compression.

Community
  • 1
  • 1
dbrown0708
  • 4,544
  • 4
  • 25
  • 22