rename ns_return ns_return_safe
rename ns_returnz ns_return
Thanks to everyone who has responded thus far - great info!
What about having a server config boolean to enable or disable gzip encoding globally for all content? Anyone familiar with how Apache, or other web servers, handle this?
I'm not sure this could be done well in a single, global manner. Instead, hooks for the three most common request paths directly in the aolserver core may be needed:
- In ADP, set headers and gzip output right after text encoding translation in AdpFlush. In streaming mode (rarely used or useful), ignore.
- In Fastpath (i.e., the static file code) do an internal-redirect to a compressed file on disk, creating it when it doesn't exist or is stale (i.e., stat both original and compressed each request which should be fine).
- For Tcl procs, modify the various ns_return functions to compress text results as with ADP, ignoring cases where Tcl procs are used to send files and such (better aligning those commands with the Fastpath is general is another low-priority todo).
I'm not familiar with how portable/clean/thread-safe the gzip library stuff is - perhaps this stuff should be a compile time option triggered on with a --with-gzip= style autoconf thing (ugly as that may be).
-Jim
