Forum Discussion

tidenz_92110's avatar
tidenz_92110
Icon for Nimbostratus rankNimbostratus
Sep 08, 2009

Compression based on user agent

Hi Guys

 

 

I am looking to mimic some functionality we have currently with our apache servers on the bigip where based on the user agent certain content is compressed. Rather than reinventing the wheel has anyone done something similar?

 

 

My initial thinking is to if/elseif based on user agent and a Data set to specifiy which content can be compressed.

 

 

Is my idea workable?

 

 

BrowserMatch ^Mozilla/4 gzip-only-text/html

 

BrowserMatch ^Mozilla/4\.0[678] no-gzip

 

BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|pdf|swf)$ no-gzip dont-vary

 

Header append Vary User-Agent env=!dont-vary
  • If you search user-agents on this site you will find plenty of examples of using IF/ELSEIF or switch statements with user-agents.

     

     

    I hope this helps

     

     

    CB