We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Disable GZIP Compression in module

Development and Programming

evasion's avatar
evasion
58 posts
about 17 years ago
evasion's avatar evasion

Hello,

I’m using EE with GZip Compression activated and the whole site is working fine except one part :

I’ve some flash application that communicate with an EE module using POST : - Flash send data to PHP module using $_POST - PHP Parse it and reply using :

echo "&valid=true"; // If it's valid
echo "&valid=false&error=my_error"; // If it's not valid

There is some weird problem with this : when trying on my development server everything works fine, but when on production server (with gzip support of course) it’s broken, but other pages are working fine.

After a few (long) search I’ve found that when disabling Gzip compression in the control panel, my flash application is working fine.

Altough it might be a solution, I would prefer to keep gzip compression active, and simply disable it in my PHP module.

I’ve tried something like that :

$PREFS->ini('gzip_output') = 'n';

but it don’t work… So my question : is it possible to disable gzip compression just for one module or not ?

Thanks in advance for your support !

Cheers,

       
evasion's avatar
evasion
58 posts
about 17 years ago
evasion's avatar evasion

I’ve found some dirty way to do it, but if someone has a cleaner solution don’t hesitate to post it !

/** -----------------------------------
/**  Compress the output
/** -----------------------------------*/

if ($PREFS->ini('gzip_output') == 'y' AND REQ == 'PAGE')
{
    if($IN->fetch_uri_segment(1) != "mytrigger") {
        ob_start('ob_gzhandler');
    }
}

Modified code in core.output.php at line 375.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.