Forum Discussion

Lior_Cohen_2771's avatar
Lior_Cohen_2771
Icon for Nimbostratus rankNimbostratus
Aug 30, 2017

TCL error: <cache_response> - Out of bounds (line 2) invoked from within "CACHE::header replace X-Cache "HIT F5""</cache_response>

I'm Getting an error on My Irule

the rule need to indecate when the respond is a cache respond or an HTTP Respond

the Rule also change the "Cache-Control" header to Private to prevent from unknown Proxy\cache system to cache my content

when HTTP_RESPONSE {
    HTTP::header insert X-Cache "MISS F5"
    if {[string length [HTTP::header "Cache-Control"]]} {
       set new_cache [string map -nocase {"public" "private"} [HTTP::header "Cache-Control"]]
       HTTP::header replace Cache-Control $new_cache
    }
    }
    when CACHE_RESPONSE {
    CACHE::header replace X-Cache "HIT F5"
    if {[string length [CACHE::header "Cache-Control"]]} {
        set new_cache [string map -nocase {"public" "private"} [CACHE::header "Cache-Control"]]
        CACHE::header replace Cache-Control $new_cache  
    }
    }