Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a PHP application under Apache that generates Excel files that are exact the same during a day just with different the names. The names are generated randomly and are killing the server because they are getting bigger and the user number is increasing too. Is Nginx able to help me on this? Any suggestions?

share|improve this question

Playing around with the proxy_cache_key (and creatively using different variables for it) might get you to where you want to be. However, I suspect your best answer is to modify the code that generates those files to use a singular name when the content doesn't change; off the top of my head a very simple solution would be to use the MD5 hash of the file's contents as the file name. Nginx would be able to trivially cache that for you (but see the other caching settings on the same page I linked above to get the best bang for your buck).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.