|
Ok guys, I may be missing something, so I'm going to detail what I've done and you can tell me what I've missed while setting up ns_ad_compress on my server, for reference, we use AOL Server 4.0.10 and our flavor of ACS (scalled down to trim the fat) What I did: - Compiled the AOL Server with zlib enabled and got positive confirmation on all compression relevant messages checking whether to include zlib compression support... yes checking for zlib.h... yes checking for compress2 in -lz... yes - Added the following lines in my .tcl config file ns_section ns/server/bayt/adp/compress ns_param enable true ns_param level 4 ns_param minsize 0 - placed <% ns_adp_compress %> at the end of every ADP file, we generate ADP files from multiple module files, so this was a 2 second job. As you may have imagined, this did nothing, I know this because when I restarted the server and went to view the response headers on Firefox, they didn't have the "Content-Encoding: gzip" entry. So I embarked on a crusade to debug and figure out what I missed, initially I stayed on the TCL code and when I exhausted that, I turned to the AOL Server C code (very clean by the way) I started looking at adprequest.c, specifically the AdpFlush function, it detailed a set of checks to initiate compression as follows, /* * Should we compress the response? If the ADP requested it with * ns_adp_compress, * IF * enabled in the server config * headers haven't been sent yet * not a HEAD request * streaming isn't turned on * the response meets the minimum size per the config * the browser indicates it can accept it * THEN do * we compress the response. */ if ( itPtr->adp.compress && itPtr->servPtr->adp.compress.enable && !(conn->flags & NS_CONN_SENTHDRS) && !(conn->flags & NS_CONN_SKIPBODY) && !stream && len >= itPtr->servPtr->adp.compress.minsize && (ahdr = Ns_SetIGet(Ns_ConnHeaders(conn),"Accept-Encoding")) != NULL && strstr(ahdr, "gzip") != NULL && Ns_CompressGzip(buf, len, &cds,itPtr->servPtr->adp.compress.level) == NS_OK) { I went through these checks and everything was in order, then I started sticking comments like these in the C code and re-compiling the server, Ns_LogSeverity severity; severity = Notice; Ns_Log(severity, "%s", "fooo" ); To my surprise no request was going into AdpFlush all the request where going through NsAdpFlush and I can't find any documentation on what would cause this, at some point I thought it may be an interpreter issue, so I switched to fancy and back again and that still made no difference. This is probably some one liner in the config that I missed somehow, a little help would be nice. -- Nader S. Henein Senior Applications Architect Bayt.com
|
- [AOLSERVER] ns_ad_compress setup headache Nader Henein
- Re: [AOLSERVER] ns_ad_compress setup headache Mark Mcgaha
- Re: [AOLSERVER] ns_ad_compress setup headache Nader Henein
