<div dir="ltr"><p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">Hi,</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">I am trying to enable client side
cache handling but not working for some unknown reasons. I will get two
parameters to read from <font>origin's response</font></span></font></p><p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"></span></font></p><p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><font></font> .i.e </span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><br></span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">1. Edge-control:
downstream-ttl=200s</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">2. Edge-control:
cache-maxage=200s</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> </span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> </span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">RULES:-</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><br></span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">This goes in
vcl_fetch</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> if ( beresp.http.Edge-control ) {<br> if (beresp.http.Edge-control ~ "cache-maxage") {<br> set beresp.ttl = std.duration(regsub(beresp.http.Edge-control, "cache-maxage=([0-9]+).*", "\1s"), 0s);<br>
#set beresp.http.Cache-Control = regsub(beresp.http.Edge-control, ".*cache-maxage=([0-9a-z]+).*", "\1");<br> #set beresp.http.X-AGEBACKEND = "yes";<br>
} elseif ( beresp.http.Edge-control ~ "downstream-ttl=([0-9]+)s") {<br> set beresp.http.Cache-Control = regsub(beresp.http.Edge-control, "downstream-ttl=([0-9]+).*", "maxage=\1" + "s");<br>
}<br> unset beresp.http.Edge-control;<br> return (deliver);<br> }</span></font></p><p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> </span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><font>It exists as soon as i<font>t matche<font>s any of the criteria and does not do a lookup for other Cac<font>he parameter and delivers<font>.</font></font></font></font></font></span></font><br>
</p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><br></span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> 1. It should enter the loop only if the Response header <font>has Edge-Control<font>.</font></font></span></font></p><p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><font><font><font>2. check for <font>matching parameters<font> and set else follow the vcl.</font></font></font></font></font></span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"><font><font><font><font>3. If only cache-maxage contains it should <font>check for Cache Control headers below in the vcl (this does not <font>work; want it to work)</font></font></font></font></font></font></span></font><br>
</p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> </span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt">No Idea what is going is wrong
here.</span></font></p>
<p class=""><font face="Verdana"><span style="font-family:Verdana;font-size:10pt"> </span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"> </span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"><span style="float:none;word-spacing:0px"> </span></span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"><span style="float:none;word-spacing:0px"> </span></span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"><span style="float:none;word-spacing:0px"> </span></span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"><span style="float:none;word-spacing:0px"> Regards,</span></span></font></p>
<p class=""><font face="Times New Roman" size="3"><span style="font-size:12pt"> Anand Shah</span></font></p></div>