LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Allow forcing the Content-Encoding: gzip header

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2010, 12:23 PM
jshreve jshreve is offline
New Member
 
Join Date: Aug 2010
Posts: 1
Default Allow forcing the Content-Encoding: gzip header

Hello,

I am trying to implement some code with PHP to do a technique described by Steve Sounders (do a Google Search for 'forcing gzip compression').

The simplest part of this is having a script that is always gzipped. To do this I need to set a header like so

Code:
header("Content-Encoding: gzip");
The problem is this header still needs to be set if Accept-Encoding is missing or does not include "gzip" or "deflate".

This works fine on other server softwares and various other tests I have done. I am running into an issue with LiteSpeed however: If I don't set Accept-Encoding via the browser LiteSpeed and PHP ignore my Content-Encoding line and the output of the page is not forced.

The following is a test and directions on how you can easily replicate this problem:
  1. Stick pastebin.com/2L0f9C6y on a LiteSpeed server with PHP active.
  2. Install addons.mozilla.org/en-US/firefox/addon/966/ so that you can disable the Accept-Encoding header.
  3. Open the tamper plugin and click "Start Tamper" and load the script. It should give you a popup. Uncheck "Continue Tamper" and click the Tamper button. You can remove the Accept-Encoding header by right clicking and and selecting delete. Hit OK.

When you load the script with Accept-Encoding and view the headers for the page you will notice Content-Encoding is not set. If you refresh and leave Accept-Encoding intact Content-Encoding is set. Again, this works on other server softwares and seems to be something LiteSpeed related.

Is there a configuration option somewhere where I can tell Litespeed to allow this behavior or something else I can do to fix this?
Reply With Quote
  #2  
Old 08-01-2010, 06:20 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
LiteSpeed has internal logic to uncompress upstream compressed content if client does not accept gzip compression.
It is a feature, not a bug, and there is no way to turn it off.
Reply With Quote
Reply

Tags
accept-encoding, content-encoding, gzip, headers, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:57 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.