473,505 Members | 14,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ob_gzhandler won't work with SSI?

I've enabled ob_gzhandler in my php.ini using the line below:
output_handler = ob_gzhandler

(I believe this means I won't have to put the ob_start line at the top of
every page, right?)
Using this does seem to speed up page load. However, when I include files in
the HTML pages using SSI:
<!--#include virtual="/includes/header.php"-->

the portion of the page that would have been the output from the header.php
script is garbage.

Any ideas?


Jul 17 '05 #1
5 1690
You're putting gzipped data into an HTML stream that is sent to the
browser non-gzipped. The browser doesn't know that that part of the
HTML stream is gzipped.

Change the HTML file to a PHP file and then require-in the header.php
file. That should work.

Really, if you want everything to be gzipped to save bandwidth, why are
you still using plain HTML files anyway?
Jul 17 '05 #2

"Blank" <bl***@example.net> wrote in message
news:s%******************@newssvr30.news.prodigy.c om...
You're putting gzipped data into an HTML stream that is sent to the
browser non-gzipped. The browser doesn't know that that part of the
HTML stream is gzipped.

Change the HTML file to a PHP file and then require-in the header.php
file. That should work.

Really, if you want everything to be gzipped to save bandwidth, why are
you still using plain HTML files anyway?


There are thousands of HTML files that were created years ago, so renaming
and fixing links is not an option. Is there anyway to restrict ob_gzhandler
to only compress files in a certain directory? For instance, only compress
files in www.domain.com/abc/ and leave everything else alone?

Thank for your help

Jul 17 '05 #3
DesignGuy wrote:
There are thousands of HTML files that were created years ago, so renaming and fixing links is not an option. Is there anyway to restrict ob_gzhandler
to only compress files in a certain directory? For instance, only compress
files in www.domain.com/abc/ and leave everything else alone?


Oh, I see. Well, I have no idea about the resticting to a certain
directory.

Maybe you could write a PHP script to change all the HTML files to PHP
files and alter the links within them as well. All it has to do is
rename the files have a ".php" extension and then change the links
within to point to ".php" instead of ".html". Of course you should back
up the existing files first, and test the script on a different set of
data, but it seems like it should be possible.
Jul 17 '05 #4

"Blank" <bl***@example.net> wrote in message
news:EA*******************@newssvr11.news.prodigy. com...
DesignGuy wrote:
> There are thousands of HTML files that were created years ago, so

renaming
and fixing links is not an option. Is there anyway to restrict ob_gzhandler to only compress files in a certain directory? For instance, only compress files in www.domain.com/abc/ and leave everything else alone?


Oh, I see. Well, I have no idea about the resticting to a certain
directory.

Maybe you could write a PHP script to change all the HTML files to PHP
files and alter the links within them as well. All it has to do is
rename the files have a ".php" extension and then change the links
within to point to ".php" instead of ".html". Of course you should back
up the existing files first, and test the script on a different set of
data, but it seems like it should be possible.


Unfortunately, also not on option since the search engines have indexed the
existing site structure thoroughly and with good rankings.

If I figure it out I'll post in this thread.

Thanks again for your help; at least I know why I was getting the garbage
characters.

Jul 17 '05 #5

"DesignGuy" <do********@nowhere.com> wrote in message
news:LEhHd.10757$ox3.6607@attbi_s04...
I've enabled ob_gzhandler in my php.ini using the line below:
output_handler = ob_gzhandler

(I believe this means I won't have to put the ob_start line at the top of
every page, right?)
Using this does seem to speed up page load. However, when I include files in the HTML pages using SSI:
<!--#include virtual="/includes/header.php"-->

the portion of the page that would have been the output from the header.php script is garbage.

Any ideas?

SOLUTION:

I ended up using zlib.output_compression as it was recommended over
ob_gzhandler. I put the following two lines in an .htaccess file in the
directory I wanted to compress:

php_flag zlib.output_compression On
php_value zlib.output_compression_level -1

It seems to work fine.

BTW, -1 compression level is the system default. It can range from 0-9 with
9 being the highest compression. I did not see much difference between -1
and 9 so I left it at -1 (default).


Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
12897
by: Kerry Neilson | last post by:
For the past couple of months, Idle won't start when I invoke it. I am at a complete loss for why this is. When this happens, they python command line still starts, and python works fine...
3
6157
by: DFS | last post by:
I've been working around this for years (I believe), so I figured someone here might know: Why won't a crosstab query accept a value from a form reference? TRANSFORM...
7
1762
by: simon | last post by:
I have simple html(aspx) page, but vertical height won't work. Even if i had set the height of a table=100%, the table is not 100% height. I spend a lot of time(my real page is more...
3
5040
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
11
1805
by: John Ortt | last post by:
Hi everyone. I have a database which I have developed in Access 2000 which is working nicely. The problem is that my customer only has Access 97. I tried to convert the database but the main...
7
11182
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The...
2
1286
by: scitrenbaum | last post by:
Here is the dilemma. I have a website where everything works perfectly in all browsers except for Safari. When you are in Safari and you go to this page... ...
2
2958
tpgames
by: tpgames | last post by:
Two days ago, MS office Word would type JP fonts, I thought. I didn't think I was using Works. Now, it won't type in JP. Jasc Paint shop pro 8, should type JP fonts because I am using XP, according...
4
2493
by: z55177 | last post by:
My domain: http://www.esthevision.cz/ This is the cause of my problem. The template is supposed to look somewhat like this: PINK STRIPE http://themebot.com/website-templates/ht... I created an...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.