Author Topic: NetScaler Compression causes Cache-Control header to say private  (Read 8890 times)

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
I am not sure why that is, but if you turn on compression, which you should, the compressed files will have Cache-Control header showing private.  I have tested it on ver 7 only.  In order to fix this, SSH into the box and type shell then the following command:
nsapimgr -ys cmp_no_cc_hdr=1

This is a volatile command, so it'll disappear upon reboot.  You'll need to vi into /nsconfig/rc.netscaler and put that same line in there.  If the file does not exist, create it.

If you are running your NetScaler in HA pair, you will need to do this on both boxes as it does not sync over.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 152
  • Karma: 18
The reason why CC: private is added is to help prevent intermediate caches from caching a compressed object if the browser doesn't support it.  The solution you provide will completely remove the CC header in this case, so you are somewhat taking things in your own hands.  An alternative is to use the command:

nsapimgr -ys add_vary_header=1

This will replace the CC: private header with a vary header instead, which most caches will be able to understand.  Standard nsapimgr disclaimer:  Add to rc.netscaler if you wish to keep the changes across reboots.

The Oracle

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
You are an Oracle!  Thanks much.

Offline NetScalerssavekittens

  • Contributor
  • *
  • Posts: 1
  • Karma: 0
Oracle makes a good point here but if your intermediate cache handles Public and the servers are already injecting it then no header is perfectly acceptable.

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 378
  • Karma: 22
We should start a thread on nsapimgr command...

Like build our own documentation on it....

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 152
  • Karma: 18
sigh.  I could rattle off on what almost any of those commands does, and if I don't know, it may not do anything.  <grin>

some favorites:

-ys httprespbandwidth=1460 # keep track of http response sizes based on 1460 byte ranges
-d httprespbandstats # display http response sizes based on the value set above

-ys httpreqbandwidth=1460
-d httpreqbandstats # same as above, but for requests, not responses
# note:  very useful for monitoring the typical request and response sizes--you would be amazed at how many responses are smaller than requests on most common sites, usually for 304's.

-ys compressbypass=99 # disables compression as the cpu hits 99%
-ys zombie_timeout=1100 # 8.1 exposes this in the GUI/cli, sets the connection cleanup interval in 10ms intervals
-ys mon_skip_maxclient=1 # for tcp based monitors, if the maxclient has been reached, monitoring won't occur--this changes the behavior
-ys csw_state_update=1 # has CS vservers track the default binding for state, allowing RHI and GSLB to work at times
-ys add_vary_yeader=1 # inserts vary instead CC: private for compressed content
-ys cmp_no_cc_hdr=1 # adds no header on compression, not just a vary or cc: private
-ys drop_df_flag=1 # drop the df flag on all packets through NS
-ys compressquantum # the size of the compression buffer, larger==higher latency, but higher compression
-ys snmpet=on # undocumented behavior to let you enable/disable services and vservers via snmp.
-ys cmp_remove_ae=1 # non-rewrite way to strip the AE header from requests to server
-ys usip_noreuse_nolimit=1 # avoids the 64k limit for USIP http connections to servers, will preserve the source port from the client

The Oracle

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 378
  • Karma: 22
I was watching the Golden Compass last night and a single phrase comes to my mind:
"The more you know, the less you dont know..."
And finally I have some testing to do, because... this knowledge is like a new toy!!!

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 152
  • Karma: 18
You best play with these on non-production boxes...

The Oracle

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 378
  • Karma: 22
Dont worry I have a Lab with four netscalers for my amusment...

I would never test these commands on one of our client's netscaler...