in reply to Preprocessing with some.pl for some.shtml requests on Apache

I am commenting own my on posting.

I have been experimenting, and one option I was able to come up with was to either do an SSI include to a script if I do not need to write to the http-headers.

If I do need to set something in the http-headers, I can load the script in place of one of the page images, do the processing I need to do, and then serve the image.

This only works if I do not need to have the page perform some function where it is not redirecting to itself in different phases of the script. That would only break the image. The solution I came up with was to substitute the default image with one intended to trick the user into voluntarily clicking a direct link to the full script by making the image which loads say something like "Click here to activate feature X". The script now has the opportunity to perform the needed functions with none of the limitations of being called as a part of a static page. Then when the task is done, the script redirects to the static page the user came from and sends a confirmation to tell the user it was a success. The confirmation is done as a SSI include.

The script only serves the "Activate" image once. As soon as the needed function has been performed, it goes to the default image.

A bunch of work, but it lets me keep the static page model. This way, running scripts is kept to the minimums of necessity hopefully to the benefit of the server's workload.
  • Comment on Re: Preprocessing with some.pl for some.shtml requests on Apache