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

Is it possible to do an additional request for each request served by Nginx?

I have a MySQL database in which I store an ID and the number of impressions for each content ID. Each time a dynamic page is generated I increment the impressions value for the corresponding ID. I want to do the same for static content, I therefor would like to call a Perl script to update the database as a sub-request or in background.

I tried using the Embedded Perl Module, this can do the update in MySQL but I am unable to serve the requested page once the update has been done. Is it possible to call this Perl module as a sub request, or are there any alternatives?

In short, this is what I'm trying to do: request static page: -> run a script to update the number of impressions for ID 12345 -> return static file 12345.html

share|improve this question will do what you're asking in the opposite order, which will get the response to the client faster.

share|improve this answer
That was easy. Thank you very much!! – Dee Feb 27 '12 at 18:22

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.