Forum Discussion
meja_127775
Nimbostratus
Nov 13, 2005enable compression if parameter exists in content type
Newbie here. I'm trying to compress data with content type "text/html;charset=UTF-8". I do not want to compress the data if the parameter is missing i.e content type "text/html" should not be compressed but "text/html;charset=UTF-8" should.
I've tried using the following rule but without success.
when HTTP_RESPONSE {
set content_type [string tolower [HTTP::header Content-Type]]
if { $content_type contains "text/html;charset=UTF-8"}{
COMPRESS::enable
}
}
- JRahm
Admin
change UTF in your if statement to utf since you are converting the content type information to lowercase. - meja_127775
Nimbostratus
Thanks for the responses...
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