<div dir="ltr">Hi Jason.<div><br></div><div>Docwilco from Fastly has written an URL encoder/decorder VMOD that you can use. You could run it through it twice or patch it do uppcase/lowercase the encoding.</div><div><br></div>

<div><a href="https://www.varnish-cache.org/vmod/url-code">https://www.varnish-cache.org/vmod/url-code</a><br></div><div><br></div><div>Varnish itself doesn't try to interpret the URL much.</div><div><br></div><div>Per.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 11:01 AM, Jason Woods <span dir="ltr"><<a href="mailto:devel@jasonwoods.me.uk" target="_blank">devel@jasonwoods.me.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I apologise if this is the wrong place for a general question / request for advice about Varnish. If there's a better place, please do let me know!<br>
<br>
I have a URL (that I've modified) that has an url encoded sequence, e.g. /block/jason%E2%80%99s-first-blog<br>
That sequence is a fancy apostrophe. It must have snuck into the title through a copy and paste or something, but it brought up some caching issue with the encoding.<br>
<br>
We notice that when we printed the URL links in HTML, it was printed as above, %E2%80%99. But when some browsers appear to request the URL, it seems to lowercase the encoding to %e2%80%99. So we ended up with two instances of this page cached. Presumedly the browser decoded the URL and then re-encoded it for the request.<br>


This meant that when we modified the blog post we sent a PURGE for %E2%80%99 - but it only updated one instance of the cache, and there were many people seeing the old version. We ended up having to manually PURGE the other cache.<br>


<br>
Would I be right in saying that the following two URL are identical, and should have one instance of cache? I'm not sure if this is accounted for in RFC/ISO of anything. URLs are generally case-sensitive IIRC but is it true also for encodings?<br>


/block/jason%E2%80%99s-first-blog<br>
/block/jason%e2%80%99s-first-blog<br>
<br>
Is there a way for Varnish to decode the URL before hashing for the cache? Or is there a better approach?<br>
We are using varnish-3.0.3 revision 9e6a70f, which may be quite old, maybe this is fixed in a recent version?<br>
<br>
Thanks!<br>
<br>
Jason<br>
<br>
<br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div style="font-size:12.727272033691406px;margin:5px 15px 0px 0px;padding-bottom:5px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">

<table border="0" cellpadding="0" cellspacing="0" style="text-align:start;font-size:12px;line-height:1.5em;font-family:'Helvetica Neue',Arial,sans-serif;color:rgb(102,102,102);width:550px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(238,238,238);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);margin-top:20px;padding-top:5px;padding-bottom:5px">

<tbody><tr><td width="100" style="font-family:arial,sans-serif;margin:0px"><a href="http://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.varnish-software.com/static/media/logo-email.png" style="float:left;margin-left:10px"></a></td>

<td style="font-family:arial,sans-serif;margin:0px"><b style="font-size:14px;color:rgb(34,34,34)">Per Buer</b><br>CTO | Varnish Software<br>Phone: +47 958 39 117 | Skype: per.buer<br><span style="font-weight:bold">We Make Websites Fly!<br>

<br></span><span style="font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;font-weight:bold">Winner of the Red Herring Top 100 Global Award 2013<br></span><p style="margin:0px;line-height:normal;font-family:Helvetica">

<img src="https://www.varnish-software.com/sites/default/files/redherring_2013_winner_sml.jpg"></p><span style="font-weight:bold"><br></span></td></tr></tbody></table><div></div></div><div style="font-size:12.727272033691406px;margin:15px 0px;clear:both;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">

</div></div>
</div>