Forum Discussion

Adminet_1714's avatar
Adminet_1714
Icon for Nimbostratus rankNimbostratus
Apr 23, 2009

Modifying the content of an HTML page when it's compressed

Hello dear forum.

 

 

I would like to modify the content of an HTML page (to replace a string by another one).

 

 

I've found an irule for this here :

 

http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=5715457154

 

 

 

The problem is that the content of this page is sent compressed by the HTTP server. So the irule never finds the string I want to replace.

 

 

Do you know if there is a way to analyse compressed content or to "decompress" an HTML page on the Big IP ?

 

 

 

Technical information : we are running on BIG-IP 9.4.4 Build 73.1 Hotfix HF1.

 

 

 

Thanks in advance for your help.

 

 

 

Jean-Guillaume.
  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    Is there any way to disable compression in the web server, via configuration? You could try that first, then let your LTM do compression.

    Another way is to fool your webserver into *not* compressing content by stripping out the Accept-Encoding headers sent by the client with an iRule. Your server would send back uncompressed text, which you'd be free to manipulate (and then compress in hardware). You could do that in a rule as simple as this:

        
     when HTTP_REQUEST {    
        if { [HTTP::header exists "Accept-Encoding"] } {    
           HTTP::header remove "Accept-Encoding"    
        }    
     }