Re: Gzip and Ajax
- From: slangtruth@xxxxxxxxx
- Date: Tue, 3 Mar 2009 08:08:02 -0800 (PST)
On Mar 3, 10:11 am, "Álvaro G. Vicario"
<alvaro.NOSPAMTH...@xxxxxxxxxxxxxx> wrote:
slangtr...@xxxxxxxxx escribió:
The problem is that if I put ob_start("ob_gzhandler"); (which you can
Google if you don't know what I'm talking about) in the script which
builds the form, presumably it buffers all screen data and gzips it,
then sends it to the browser with a header saying it's gzipped. It's
all done then. When the second script is called by Ajax it sends no
headers, just a single echo(...) containing the screen it's built,
which the Ajax function catches and squirts into the DIV waiting on
the form page. It's that output which needs the buffering, the data
for the form screen is trivial. Any way to do it?
Sorry, I hadn't actually paid attention to the main post. That's not how
HTTP or AJAX work. Every request to the server is independent (even the
pictures linked in <img> tags!) and has its own headers, whether you
write them yourself or they're all generated by the PHP interpreter or
the web server.
It looks like you're trying to fix a problem you don't have. I suggest
you install the Firebug extension for Firefox, enable the Net
panel for your dev site and see by yourself how things run in the
background.
Also: "ob_gzhandler() determines what type of content encoding the
browser will accept and will return its output accordingly."
http://es.php.net/ob_start
--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor al baño María:http://www.demogracia.com
--
Thanks, Alvaro, that was the key. I have Firebug, but had never
noticed the Net tab before. Looking at it, I see that although the
length of my AJAX data is unknown (represented by a ?), by checking
the headers for that segment I can see that it is actually getting
gzipped. Thanks for the help!
.
- References:
- Gzip and Ajax
- From: slangtruth
- Re: Gzip and Ajax
- From: Jerry Stuckle
- Re: Gzip and Ajax
- From: DaNieL
- Re: Gzip and Ajax
- From: "Álvaro G. Vicario"
- Re: Gzip and Ajax
- From: slangtruth
- Re: Gzip and Ajax
- From: "Álvaro G. Vicario"
- Gzip and Ajax
- Prev by Date: How to automatically return from a CGI script?
- Next by Date: Re: How to automatically return from a CGI script?
- Previous by thread: Re: Gzip and Ajax
- Next by thread: ssl + wire money
- Index(es):
Relevant Pages
|