Welcome! Log In Create A New Profile

Advanced

Re: Is it possible to send html HEAD early (chunked)?

mex
July 13, 2014 12:37PM
> Ok, I haven't done anything with nginx+lua so far, need to check out
> what
> can be done with lua. Can you give some direction how lua can be
> helpful here?

oh ... lua might be used to manipulate every single phase of a request
coming to and processed by nginx; so a swiss army knife
super-extended version :)


some stuff to skim through to get an impression:
- https://github.com/openresty/lua-nginx-module#typical-uses
- http://wiki.nginx.org/HttpLuaModule

in your case i'd say the cleanest way would be a reengineering
of your application; the other way would imply a full regex
on every request coming back from your app-servers to filter out
those stuff that already has been send.
the problem: appservers like tomcat/jboss/rails a.s.o.
usually send full html-pages; if you find a way to just
send the <body> itself, the rest like sending html-headers early
from cache seems easy:


location /blah {
content_by_lua '
ngx.say(html_header)
local res = ngx.location.capture("/get_stuff_from_backend")
if res.status == 200 then
ngx.say(res.body)
end
ngx.say(html_footer)
';
}


do you refer to something similar to this?
https://github.com/bigpipe/bigpipe







>
> > from what i understand you have a "static" part that should get send
> > early/from
> > cache and a "dynamic" part that must wait for the backend?
>
> Exactly.
>
> Cheers,
> Martin
>
> > the only solution i could think of in such an asynchronous delivery
> > is using nginx + lua, or maybe varnish (iirc you yould mark parts of
> a
> > page cacheable, but dont know if you can deliver asynchronously
> though)
> >
> >
> >
> > regards,
> >
> >
> > mex
> >
> > Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,251717,251719#msg-251719
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 08:50AM

Re: Is it possible to send html HEAD early (chunked)?

mex July 13, 2014 09:40AM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 11:36AM

Re: Is it possible to send html HEAD early (chunked)?

mex July 13, 2014 12:37PM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 02:54PM

Re: Is it possible to send html HEAD early (chunked)?

mex July 14, 2014 08:23AM

Re: Is it possible to send html HEAD early (chunked)?

Valentin V. Bartenev July 13, 2014 04:02PM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 06:28PM

Re: Is it possible to send html HEAD early (chunked)?

Maxim Dounin July 14, 2014 08:56AM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 14, 2014 02:36PM

Re: Is it possible to send html HEAD early (chunked)?

Maxim Dounin July 15, 2014 08:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
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