Welcome! Log In Create A New Profile

Advanced

Re: njs: output compression?

Gunter Grodotzki
April 29, 2021 02:24AM
Hi :)

So my njs script is outputting html but I would like that output to be compressed for the client (if the client supports).

So kind hoping that gzip or brotli module would be chained after njs, but seems that is only the case if you do an internalredirect.

Cheers,
Gunter

> On 29 Apr 2021, at 04:23, Sergey A. Osokin <osa@freebsd.org.ru> wrote:
>
> Hi Gunter,
>
>> On Thu, Apr 29, 2021 at 03:34:39AM +0200, Gunter Grodotzki wrote:
>> Hi all,
>>
>> Is there a simple way that I am missing to enable output compression for njs
>> scripts?
>
> I don't think it's good practice to use the njs module for
> a compression or any other heavy-math calculations.
>
>> It seems to be working for r.internalRedirect(‘/foo.html’)
>>
>> But not for:
>> r.headersOut['Content-Type'] = 'text/html; charset=UTF-8'
>> r.return(200, someHtml)
>
> Could you share more light about goals you're doing to archive
> in this case.
>
> --
> Sergey Osokin
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

njs: output compression?

Gunter Grodotzki 76 April 28, 2021 09:36PM

Re: njs: output compression?

Sergey A. Osokin 8 April 28, 2021 10:24PM

Re: njs: output compression?

Gunter Grodotzki 10 April 29, 2021 02:24AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 74
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready