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: http://mysite.com/document/12345.html -> run a script to update the number of impressions for ID 12345 -> return static file 12345.html