2010년 9월 15일 수요일

[irule] Http response check rule

when HTTP_REQUEST {
set request_time [clock clicks -milliseconds]
set uri [HTTP::uri]
}

when HTTP_RESPONSE {
# milliseconds is 1/1000 second
set response_time [expr [clock clicks -milliseconds] - $request_time]
if { $response_time > 10}
{
log local0.warn "Response time ${response_time}ms uri is $uri from [clientside {IP::remote_addr}]:[clientside {TCP::remote_port}]."
}
}

[irule] header rewrite for Local cache V 10.x

when HTTP_REQUEST {
      
if {[HTTP::method] eq "GET" and [HTTP::uri] eq "/"}{  
 set expire_content_timeout 300      
  } else {    
set expire_content_timeout [class match -value [string tolower [string range [HTTP::path] [string last . [HTTP::path]] end]] starts_with class_cacheable_file_types]
log local0. "[string range [HTTP::path] [string last / [HTTP::path]] end] = $expire_content_timeout " 

  }      }   
    when HTTP_RESPONSE {     
   if { $expire_content_timeout ne "" } {   
        HTTP::header replace "Cache-Control" "max-age=$expire_content_timeout, public"     

   HTTP::header replace "Expires" "[clock format [expr ([clock seconds]+$expire_content_timeout)] -format "%a, %d %h %Y %T GMT" -gmt true]"    
    } else {      
     #HTTP::header replace "Cache-Control" "private"    
           HTTP::header replace Expires {-1}    
        }  
  }

[irule] header rewrite for Local cache V 9.x

when HTTP_REQUEST {
      
if {[HTTP::method] eq "GET" and [HTTP::uri] eq "/"}{  
 set expire_content_timeout 300      
  } else {    
set expire_content_timeout [findclass [string tolower [string range [HTTP::path] [string last . [HTTP::path]] end]] $::class_cacheable_file_types " "]

log local0.debug "$expire_content_timeout" 
#log local0.debug "[string tolower [string range [HTTP::path] [string last . [HTTP::path]] end]]"
  }      }   
    when HTTP_RESPONSE {     
   if { $expire_content_timeout ne "" } {   
        HTTP::header replace "Cache-Control" "max-age=$expire_content_timeout, public"     

   HTTP::header replace "Expires" "[clock format [expr ([clock seconds]+$expire_content_timeout)] -format "%a, %d %h %Y %T GMT" -gmt true]"    
    } else {      
     #HTTP::header replace "Cache-Control" "private"    
           HTTP::header replace Expires {-1}    
        }   
  }

2010년 9월 2일 목요일

목표 만들기

문득 얼마전에 읽은 글이 생각난다.

 

"목표가 없는 사람은 목표있는 사람을 위해 일한다.

오늘 하루도 소중하게..."

 

나는 뚜렷한 목표를 설정하지 못했다. 아니 않았다.

목표를 만들자.