FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Output compression?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Output compression? [message #12347] Tue, 05 August 2003 21:06 Go to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
I'm getting doubly-gzipped file attachments for gzip'd files. Testing here...

[Updated on: Tue, 05 August 2003 21:07]

Report message to a moderator

Re: Output compression? [message #12348 is a reply to message #12347] Tue, 05 August 2003 21:10 Go to previous messageGo to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
Works fine here.
Is PHP output compression enabled here, or mod_gzip?

If I use zlib output buffering, or the built-in PHP compression, downloading a gzip file from fudforum results in the file downloaded being gzipped twice. I haven't tried mod_gzip.
Re: Output compression? [message #12349 is a reply to message #12348] Tue, 05 August 2003 21:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I use mod_gzip because it is faster. However, when you use PHP's native compression it is very likely that the uploads would be compressed during sending. However that should not be a problem, your browser should automatically decompress the 1st level of compression.

FUDforum Core Developer
Re: Output compression? [message #12350 is a reply to message #12347] Tue, 05 August 2003 21:36 Go to previous messageGo to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
I looked in the "files" data directory. The files aren't doubly compressed there, but they become so when downloading through fudforum.

http://xod.starmen.net/forum/index.php?t=msg&th=3&start=0&S=976 243eb1d66e9171315896c9841d169

That's the file I noticed the problem with. I'm using Mozilla. The same problem also occurs with lynx, so I doubt it's a browser issue.

I would use mod_gzip, but it leaves a lot of stale temporary files around. I may have to look into using it for php again.
Re: Output compression? [message #12351 is a reply to message #12350] Tue, 05 August 2003 21:52 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
THe files on disk would not be compressed. The 2nd compression occurs when php sends the file to you. Because you have PHP compression enabled the file get's compressed again.

FUDforum Core Developer
Re: Output compression? [message #12353 is a reply to message #12347] Tue, 05 August 2003 21:56 Go to previous messageGo to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
But my browser isn't decompressing it, and I end up with a doubly-gzipped file.
Re: Output compression? [message #12354 is a reply to message #12353] Tue, 05 August 2003 22:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Does this happen to any file attachment or just the ones compressed using gzip?

FUDforum Core Developer
Re: Output compression? [message #12355 is a reply to message #12347] Tue, 05 August 2003 22:11 Go to previous messageGo to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
I uploaded a gzip-compressed file without the gz extension, and downloaded, and it was fine(same as the original that I uploaded). So it looks like it's the gz extension that is confusing something.
Re: Output compression? [message #12356 is a reply to message #12355] Tue, 05 August 2003 23:17 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Here is the url to the fix for the problem, please try it and let me know if it works for you.
http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=1740


FUDforum Core Developer
Re: Output compression? [message #12358 is a reply to message #12347] Tue, 05 August 2003 23:28 Go to previous messageGo to next message
Xodnizel   United States
Messages: 73
Registered: May 2003
Karma: 0
Member
I found out what the problem was with mod_gzip, and that I had fixed it over a month ago, and so I reenabled it, and no more problems.

I doubt that patch would work for me, anyway, though. I had the transparent zlib output compression enabled(in the PHP config file), and not output buffer+gzhandler. I needed the former for a hosted web site that used virtual() to run a cgi program. It wouldn't work with output buffering and gzhandler.

Anyway, I think you can disable that zlib stuff with an ini_set, though I can't remember off-hand how.
Re: Output compression? [message #12359 is a reply to message #12358] Tue, 05 August 2003 23:43 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, the problem is that once enabled zlib compression inside PHP scrope cannot be disabled. Meaning that the only work around is only to enable it when needed, which is what my patch does. However, if you have compressed enabled outside of the forum, this patch won't help I'am afraid.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Very long urls when using path_info on fud 2.5.2
Next Topic: Moderators List goes blank on upgrade
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 13:53:12 GMT 2024

Total time taken to generate the page: 0.01978 seconds