<html><head></head><body><div class="ydp1c1f04c8yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
<div>I use Varnish 4.1, can I just add in the vcl_hash this?</div><div><br></div><div><span><table class="ydp9fb0c0b1highlight ydp9fb0c0b1tab-size ydp9fb0c0b1js-file-line-container" data-tab-size="8" style="border-collapse: collapse; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; font-size: 14px;"><tbody><tr><td id="ydp9fb0c0b1LC236" class="ydp9fb0c0b1blob-code ydp9fb0c0b1blob-code-inner ydp9fb0c0b1js-file-line ydp9fb0c0b1highlighted" style="padding: 0px 10px; line-height: 20px; position: relative; vertical-align: top; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; white-space: pre-wrap; background-color: rgb(255, 251, 221);"> <span class="ydp9fb0c0b1pl-c" style="color: rgb(106, 115, 125);"># Cache the HTTP vs HTTPs separately</span></td></tr><tr><td id="ydp9fb0c0b1L237" class="ydp9fb0c0b1blob-num ydp9fb0c0b1js-line-number" data-line-number="237" style="padding: 0px 10px; cursor: pointer; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td id="ydp9fb0c0b1LC237" class="ydp9fb0c0b1blob-code ydp9fb0c0b1blob-code-inner ydp9fb0c0b1js-file-line ydp9fb0c0b1highlighted" style="padding: 0px 10px; line-height: 20px; position: relative; vertical-align: top; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; white-space: pre-wrap; background-color: rgb(255, 251, 221);"> <span class="ydp9fb0c0b1pl-k" style="color: rgb(215, 58, 73);">if</span> (<span class="ydp9fb0c0b1pl-smi">req.http.X-Forwarded-Proto</span>) {</td></tr><tr><td id="ydp9fb0c0b1L238" class="ydp9fb0c0b1blob-num ydp9fb0c0b1js-line-number" data-line-number="238" style="padding: 0px 10px; cursor: pointer; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td id="ydp9fb0c0b1LC238" class="ydp9fb0c0b1blob-code ydp9fb0c0b1blob-code-inner ydp9fb0c0b1js-file-line ydp9fb0c0b1highlighted" style="padding: 0px 10px; line-height: 20px; position: relative; vertical-align: top; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; white-space: pre-wrap; background-color: rgb(255, 251, 221);"> <span class="ydp9fb0c0b1pl-c1" style="color: rgb(0, 92, 197);">hash_data</span>(<span class="ydp9fb0c0b1pl-smi">req.http.X-Forwarded-Proto</span>);</td></tr><tr><td id="ydp9fb0c0b1L239" class="ydp9fb0c0b1blob-num ydp9fb0c0b1js-line-number" data-line-number="239" style="padding: 0px 10px; cursor: pointer; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td id="ydp9fb0c0b1LC239" class="ydp9fb0c0b1blob-code ydp9fb0c0b1blob-code-inner ydp9fb0c0b1js-file-line" style="padding: 0px 10px; line-height: 20px; position: relative; vertical-align: top; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; font-size: 12px; white-space: pre-wrap;"> }</td></tr></tbody></table></span> <br></div><div><br></div><div><br></div><div><br></div><div><br></div>
</div><div id="ydp37f055edyahoo_quoted_5332362940" class="ydp37f055edyahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
En jueves, 13 de diciembre de 2018 10:05:20 CET, Mattias Geniar <mattias@nucleus.be> escribió:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">> Here you have it:<br clear="none"><br clear="none">You are not caching the protocol (http or https), which will lead to different caching results depending on the backend response.<br clear="none"><br clear="none">As an example, have a look here: <a shape="rect" href="https://github.com/mattiasgeniar/varnish-6.0-configuration-templates/blob/master/default.vcl#L236-L238 " rel="nofollow" target="_blank">https://github.com/mattiasgeniar/varnish-6.0-configuration-templates/blob/master/default.vcl#L236-L238 </a><br clear="none"><br clear="none">In your Apache proxy config you can set additional headers to mark they've been passed through it (in this example, X-Forwarded-Proto) so Varnish knows to treat them differently.<div class="ydp37f055edyqt9105582370" id="ydp37f055edyqtfd13769"><br clear="none"><br clear="none">Mattias<br clear="none"><br clear="none"></div></div></div>
</div>
</div></body></html>