Jump to content
Welcome to our new Citrix community!

Safe way to enable HTTP compression for a virtual server


Jari Hietanen

Recommended Posts

We are having a production environment (LB) which includes several virtual servers.

 

Virtual server "test.service.com" is having a Netscaler APP FW in front of it, and I suspect that it prevents compressed data coming from backend server towards clients.  


That is why I would like to enable Netscaler compression feature safely only for that virtual server "test.service.com",  but not for other virtual servers.

 

I know that there is under service a settings a parameter to enable compression,  but documentation does not say clearly how it works.  This is usual case that Netcaler documentation is not giving any "real" world configuration examples.

I mean that if that parameter is not enabled is global compression policies affecting on that particular service or not?   I.E. in my case if compression is not enabled under service, is that service safe from compression even feature compression is
enabled?


I have been planning following configuration to test compression safely:


Global override policy which prevents compressing if HTTP request does not include hostname "test.service.com":


add cmp policy nocompress-override-pol -rule "HTTP.REQ.HOSTNAME.EQ(\"test.service.com\").NOT" -resAction NOCOMPRESS

bind cmp global nocompress-override-pol -priority 100 -gotoPriorityExpression END -type REQ_OVERRIDE
bind cmp global nocompress-override-pol -priority 100 -gotoPriorityExpression END -type RES_OVERRIDE

Do I need to take care of both Request and Response side or only Requests in my case? I know that compression happens only for server responses, but this is little bit confusing for me.


Compression policy for virtual server "test.service.com":

add cmp policy test-service-cmp-policy -rule "HTTP.REQ.HOSTNAME.EQ(\"test.service.com\")" -resAction COMPRESS

Compression policy which prevents anyting else compressed for virtual server "test.service.com" by global policies:
add cmp policy nocompress-cmp-policy -rule true -resAction NOCOMPRESS


bind lb vserver test-service-com-vs -policyName test-service-cmp-policy  -priority 100 -gotoPriorityExpression END -type REQUEST
bind lb vserver test-service-com-vs -policyName nocompress-cmp-policy -priority 110 -gotoPriorityExpression END -type REQUEST

 

And type "REQUEST" is correct because my policy is checking request side even compression happens on response side?

 

Does this seem sensible if I want to make sure that anything else is not compressed except traffic coming towards test.service.com virtual server?

 

And do I need to enable policy type "ADVANCED" instead of CLASSIC  under HTTP compression parameter settings so that my new Global policies come to use?

Link to comment
Share on other sites

Here's the relationship between the feature and the service/servicegroup properties:

Unfortunately, to get the NetScaler to compress traffic the feature must be enabled globally AND the feature per service/servicegroup must be ON.

For your existing services/servicegroups, the -cmp property will be OFF by default if they were created when the feature was disabled globally. If the feature was ON when they were created then this value is ON by default.  Change the current feature state from OFF to ON (or ON to OFF) does not change the state of this parameter on existing services/servicegroups, but would just change the default state on new services/servicegroups.

 

So, assuming all your existing services/services groups have compression OFF currently. Turning the global feature ON will not change the existing entities; just new entities.

 

AS an extra precaution, you could then create the compression policy globally to NOCOMP at a higher priority than the default response time policies...but it would be more flexible to bind the nocmp policy to any vservers you wanted to exlcude instead.

 

Just make sure none of your existing services/servicegroups of -cmp ON before you change the global feature value.

 

The problem with a global policy is that you then have to figure out what to compress and not compress in the expressions...so, start with the parameters first and tag a nocmp policy to vservers you want to exclude.  If you have a global NOCMP you will then have to override for the exact things you want to compress instead of letting the default policies identify that for you.

 

A few notes about compression policies:

- Don't worry about request time processing; just deal with response time compression.  Compression applies to the compressibility of responses; the response time policies are deferred to apply to the response.

 

See if this helps. I'll try to clarify this later, when I have more time.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...