To put the output of a server side script into an HTML file, should you use #include or #exec?
If I want to insert the output of a script into an HTML file usi开发者_运维百科ng server side includes, is it better to use
<!--#include virtual="/cgi-bin/myscript.py" -->
or
<!--#exec cmd="python /cgi-bin/myscript.py" -->
?
A small advantage to the #include format is that, should you change the location or name of your python executable, you only need to change the configuration once in your Apache config, rather than having to change every SSI call on your site.
Both of these forms, however, will start up and tear down a new python binary every time the script is called, which is a decently big hit. This is why something like mod_python is almost always preferred.
精彩评论