Forum Discussion
Salvatore_Berti
Nimbostratus
Nov 15, 2007how disable compression for a specific javascript?
Hi guys,
I've got a page with 3 js files
and I've been trying to disable compression for one of them using the irule below:
rule salvo_selective_compress_disable {
when HTTP_REQUEST {
if { ([HTTP::host] eq "1.1.1.1") and
([HTTP::uri] eq "/salvo/1.js") } {
log local0. "compression_rule"
COMPRESS::disable }
}
}
I can see the entry in the log but the js is still compressed, however if I use an http profile with selective compression and use the irule below I can see that only the file specified in the irule is compressed and no the other 2 (that is actually what I expect)
rule salvo_selective_compress_enable {
when HTTP_REQUEST {
if { ([HTTP::host] eq "1.1.1.1") and
([HTTP::uri] eq "/salvo/1.js") } {
log local0. "compression_rule"
COMPRESS::enable }
}
}
I don't get where the difference is, can anyone help me to figure out what is going on or give me an hint?
Thanks in advance.
Waol
- Joe_Wojcik
Employee
The COMPRESS::disable in the first rule won't work without the selective compression profile, which is why you're seeing all of the files compressed. It's listed as only working with that profile selected on the wikirule salvo_selective_compress_enable { when HTTP_REQUEST { if { ([HTTP::host] eq "1.1.1.1") and ([HTTP::uri] eq "/salvo/1.js") } { log local0. "compression_rule_disable" COMPRESS::disable } else { COMPRESS::enable } } }
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