Tomasz Wendlandt

Avatar

Tech blog

iRule’a na koniec roku.

F5 BIG-IP

Kiedyś trafiłem na taką iRule’a na DevCentral. W zależności od RTT klienta F5tka ustawia odpowiedni poziom kompresji dla serwowanej strony. Cwane:)


# rule HTTP_compression_slow_connections {
#     If client round trip time (latency) exceeds:
#     50ms  set HTTP compression to level 1
#     100ms set HTTP compression to level 5
#     RTT returns latency as 1/32 of a millisecond,
#     so 1600=50ms, 3200=100ms, etc
#     In the HTTP profile, set compression to "selective"

when HTTP_REQUEST {
  set rtt [TCP::rtt]
}
when HTTP_RESPONSE {
  if {$rtt > 1600 } {
    COMPRESS::enable
    COMPRESS::gzip level 1
  }
  elseif {$rtt > 3200 } {
    COMPRESS::enable
    COMPRESS::gzip level 5
  }
}
}

No Comments, Comment or Ping

Reply to “iRule’a na koniec roku.”

Poznań

  • Cloud and Visibility OK
  • Temperature: -13°C
  • Visibility: 10km
  • Clouds: Cloud and Visibility OK
  • Wind: E at 17 km/h
  • Barometer: 1039 hPa
  • Humidity: 60.5%
  • Sunrise: 8:11 GMT+2
  • Sunset: 20:17 GMT+2