问题
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.
- In my Sinatra app, using the API
- With Rack middleware
- In the server config for my deployment
Which of these methods is the best place for setting HTTP headers?
回答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.
来源:https://stackoverflow.com/questions/2188972/where-should-i-set-http-headers-such-as-expires