473,222 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,222 software developers and data experts.

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 1682
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
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
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
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
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
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
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
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
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
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.