adding header/footer to gzip'ed html files

Constantine A. Murenin cnst++ at FreeBSD.org
Sat Apr 27 17:41:06 UTC 2013


Hello,

I'm trying to see ways in which OpenGrok could be optimised with nginx.

One of the ideas I have is using nginx to serve the /xref/ pages, 
instead of them going through OpenGrok each time.  OpenGrok (the 
indexer) pre-generates the body of the /xref/ pages, and stores the 
resulting html as .gz files, but those files don't have any 
header/footer, and require to be presented within "<pre>" and "</pre>", 
which OpenGrok (the webapp) then adds on the fly.

Would it be possible to use `add_before_body` and `add_after_body` 
(http://nginx.org/docs/http/ngx_http_addition_module.html), together 
with `gzip_static always` 
(http://nginx.org/docs/http/ngx_http_gzip_static_module.html), together 
with `gunzip on` 
(http://nginx.org/docs/http/ngx_http_gunzip_module.html), to replace 
passing /xref/ to OpenGrok (the webapp)?

Technically, gzip / deflate is a stream encoding, so, supposedly, 
there'd be no need to decode and re-encode the .gz files, but some 
special handling will probably still have to be performed nonetheless.

I presume a scenario as above would not currently work (but I might as 
well be wrong); however, does this sound like something that's 
potentially interesting, and not overly difficult and complicated to fix 
up?  Or would it be simpler to amend all the /xref/ pages for all of 
them to redundantly include the needed header and footer?

Cheers,
Constantine.



More information about the nginx mailing list