<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-GB;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#242729;mso-fareast-language:EN-GB">When a user tries to upload content via our CMS, we're getting a incorrect permissions due to PHPSESSID not being sent.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#242729;mso-fareast-language:EN-GB">Here is my current vcl file, what would I have to change to resolve the PHPSESSID error?<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#242729;mso-fareast-language:EN-GB">As an alternative to resolving this issue (not ideal) set a section of the site to not be cached by varnish but I'm also not sure of how to do that.</span><span style="font-size:10.0pt;font-family:Consolas;color:#242729;border:none windowtext 1.0pt;padding:0cm;background:#EFF0F1;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">vcl 4.0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">import directors;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">import std;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">backend site1 {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .host = "127.0.0.1";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .port = "8080";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">backend site2 {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .host = "127.0.0.1";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .port = "8081";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">backend site3 {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .host = "127.0.0.1";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> .port = "8082";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">acl purge {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> "localhost";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> "127.0.0.1";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_recv {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # SINGLE BACKEND<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"># set req.backend_hint= default;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">if (req.http.host == "www.site2.co.uk") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.backend_hint = site2;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> else if (req.http.host == "www.site3.co.uk") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.backend_hint = site3;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> else if (req.http.host == "site1.site2.co.uk") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.backend_hint = site1;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> else {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (synth(404, "Host not found"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # SET HTTP HEADERS<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.http.X-Forwarded-For = client.ip;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.http.X-Forwarded-Proto = "https";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # REMOVE HEADERS THAT MIGHT DUPLICATE CACHE<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset req.http.Accept-Language;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset req.http.User-Agent;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # PURGE<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.method == "PURGE") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (!client.ip ~ purge) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(synth(405,"Not allowed."));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (purge);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if ( std.port(server.ip) == 6080) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.http.x-redir = "https://" + req.http.host + req.url;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (synth(750, "Moved permanently"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # DROP COOKIES AND PARAMS FROM STATIC ASSET<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.url ~ "\.(gif|jpg|jpeg|swf|ttf|css|js|flv|mp3|mp4|pdf|ico|png)(\?.*|)$") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset req.http.cookie;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set req.url = regsub(req.url, "\?.*$", "");<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # PASS COOKIES<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.http.cookie) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.http.cookie ~ "(exclude_)") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(pass);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } else {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset req.http.cookie;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_backend_response {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # RETRY BACKEND 3 TIMES IF DOWN<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (beresp.status == 503 && bereq.retries < 3 ) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(retry);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (bereq.http.Cookie ~ "(UserID|_session)") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-Cacheable = "NO:Got Session";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.uncacheable = true;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } elsif (beresp.ttl <= 0s) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-Cacheable = "YES";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } elsif (beresp.http.set-cookie) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-Cacheable = "YES";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.uncacheable = false;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } elsif (beresp.http.Cache-Control ~ "private") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-Cacheable = "NO:Cache-Control=private";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.uncacheable = true;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return (deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } else {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-Cacheable = "YES";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset beresp.http.expires;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.cache-control = "max-age=900";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.ttl = 1w;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.magicmarker = "1";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # UNSET COOKIES<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (!(bereq.url ~ "(exclude)")) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.http.X-UnsetCookies = "TRUE";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset beresp.http.set-cookie;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.ttl = 1h;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # YEAR LONG CACHE FILE TYPES<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (bereq.url ~ "\.(gif|jpg|jpeg|png)(\?.*|)$") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.ttl = 365d;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # MONTH LONG CACHE FILE TYPES<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (bereq.url ~ "\.(css|js|flv|mp3|mp4|pdf|)(\?.*|)$") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set beresp.ttl = 30d;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">set beresp.grace = 1w;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_hash {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if ( req.http.X-Forwarded-Proto ) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> hash_data( req.http.X-Forwarded-Proto );<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_backend_error {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # DISPAY CUSTOM ERROR IF FAILS<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (beresp.status == 503 && bereq.retries == 3) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> synthetic(std.fileread("/etc/varnish/error503.html"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_synth {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # REDIRECT FOR HTTP<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (resp.status == 750) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.status = 301;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.http.Location = req.http.x-redir;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"># DISPLAY CUSTOM PAGE IF BACKEND DOWN<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (resp.status == 503) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> synthetic(std.fileread("/etc/varnish/error503.html"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(deliver);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_deliver {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # RESTART IF BACKEND DOWN<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (resp.status == 503) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(restart);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (resp.http.magicmarker) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # REMOVE MAGIC MARK<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> unset resp.http.magicmarker;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> # FRESH OBJECT<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.http.age = "0";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (obj.hits > 0) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.http.X-Cache = "HIT";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> } else {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.http.X-Cache = "MISS";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> set resp.http.Access-Control-Allow-Origin = "*";<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_hit {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.method == "PURGE") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(synth(200,"OK"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">sub vcl_miss {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> if (req.method == "PURGE") {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> return(synth(404,"Not cached"));<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white;vertical-align:baseline">
<span style="font-size:10.0pt;font-family:Consolas;color:#242729;mso-fareast-language:EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>