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'm using nginx to serve static files. I have several js files and different client require different combination of the available files. Is it possible that nginx will combine the files in the request in the first time and then on subsequent requests will serve the cached combined version? Every time I'll upload a new version I'll just clear the cache folder.

Do I need to use a separate script to do it? Is it possible to use python? I rather have simplicity then speed because creating a new combination won't happen to frequently.

Client will request something like


share|improve this question

Hey, you can gzip the js files based on the file type:

gzip  on;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;

The caching part is not clear, I think those files are going to be in the operating system file system cache which is fast enough...

share|improve this answer

Your Answer


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