formatted:: does it possible with varnish and how to do it

Швабауэр Павел shvabauer at arsenal-d.uz
Tue Mar 22 10:18:12 CET 2016


Good day Per,
yes, I added return(lookup) in vcl_hash and an issue has gone!
Thanks a lot for support and for great community!

22.03.2016 14:14, Per Buer пишет:
>
>
> On Fri, Mar 18, 2016 at 10:15 AM, Швабауэр Павел 
> <shvabauer at arsenal-d.uz <mailto:shvabauer at arsenal-d.uz>> wrote:
>
>     Good day team,
>     I'm using varnish in our projects already long time, so thank you
>     very much for this great technology!
>     Let me explain 1 thing I can't realize already 2 weeks.
>
>     so, here is task. Please take a look, we are using some sort of
>     security in links, so every client has own generated links. 
>
>
>
>     (..)
>
>
>     # The data on which the hashing will take place
>     sub vcl_hash {
>       ###### here we should modify url to try to return from cache
>       if (req.url ~ "/book/$") {
>         set req.http.cacheurl = regsub(req.url,
>     "(.*)/(.*)/(.*)/(.*)$", "\1/\4");
>         std.log("hash rewrite was:" + req.url);
>         std.log("become ::: "+req.http.cacheurl);
>       } else {
>         set req.http.cacheurl = req.url;
>       }
>       hash_data(req.http.cacheurl);
>
>       if (req.http.host) {
>         hash_data(req.http.host);
>       } else {
>         hash_data(server.ip);
>       }
>     }
>
>
> Here you hand over control to the builtin VCL. The builtin VCL will 
> add req.url to the hash, which will more or less disable the caching.
>
> If you return(lookup) in vcl_hash you will stop processing.
>
> -- 
> 	*Per Buer*
> CTO | Varnish Software AS
> Cell: +47 95839117
> We Make Websites Fly!
> www.varnish-software.com <https://www.varnish-software.com/>
>
>
> <http://info.varnish-software.com/signature>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160322/299bae63/attachment-0001.html>


More information about the varnish-misc mailing list