Forum Discussion
Neo_Moon_65417
Jun 21, 2011Historic F5 Account
Sectively compression for url using “*.uif”.
Hi all,
I need help on writing iRule for selectively compressing as in the below. This is one of acceleration requirements from an liability insurance company for mobile T/F(migrati...
hooleylist
Jun 21, 2011Cirrostratus
Hi Neo,
I think you'll want to enable/disable compression in HTTP_RESPONSE based on the response content-type. Though I'm not sure it makes sense to try to compress all content from the pool that's not already compressed. I think you'd want to try to limit compression to content-types which can be compressed like text.
Also, do you want to enable or disable response compression for *.uif file requests? It looks like UIF files might already be compressed ISO images.
As far as the HTTP profile setting, the COMPRESS::enable wiki page states the following:
http://devcentral.f5.com/wiki/default.aspx/iRules/COMPRESS__enable.html
Note that when using this command, you must set the HTTP profile setting Compression to Selective.
when HTTP_REQUEST {
Prevent response compression if request is for a uif filetype
switch -glob [HTTP::path] {
"*.uif" {
set compress 0
}
default {
set compress 1
}
}
}
when HTTP_RESPONSE {
Enable compression if request was not for a uif filetype,
the response isn't already compressed and
the response is text-based
if {$compress and [HTTP::header Content-Encoding] ne "gzip" and [HTTP::header Content-Type] contains "text"}{
COMPRESS::enable
}
}
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects