Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Cache page with dynamic query string

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


travis.crowder at spechal

May 1, 2012, 4:46 PM

Post #1 of 5 (1078 views)
Permalink
Cache page with dynamic query string

I am pretty sure the answer to this is: It's not possible; but I am
hoping to learn something new.

There is a page, let's call it promo.php. We tell a bunch of people
about it and append their email address to the page for tracking ... i.e
promo.php?foo [at] bar

I believe in other to cache the page, I need to strip the query string
(since it will be unique). Is there a way for Varnish to cache this
page, yet still track the hits? i.e. Strip the query string for the
lookup and add it back on delivery.

Thanks,
Travis

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


hugues.alary at gmail

May 1, 2012, 4:50 PM

Post #2 of 5 (1052 views)
Permalink
Re: Cache page with dynamic query string [In reply to]

If the tracking is done via Javascript (like google analytics) stripping
the query string won't prevent the tracking from happening as it will
happen on the client browser.

If the tracking happens on the backend, you're out of luck.

On Tue, May 1, 2012 at 4:46 PM, Travis Crowder
<travis.crowder [at] spechal>wrote:

> I am pretty sure the answer to this is: It's not possible; but I am hoping
> to learn something new.
>
> There is a page, let's call it promo.php. We tell a bunch of people about
> it and append their email address to the page for tracking ... i.e
> promo.php?foo [at] bar
>
> I believe in other to cache the page, I need to strip the query string
> (since it will be unique). Is there a way for Varnish to cache this page,
> yet still track the hits? i.e. Strip the query string for the lookup and
> add it back on delivery.
>
> Thanks,
> Travis
>
> ______________________________**_________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc<https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc>
>



--
Hugues ALARY


travis.crowder at spechal

May 1, 2012, 4:54 PM

Post #3 of 5 (1063 views)
Permalink
Re: Cache page with dynamic query string [In reply to]

Thanks for your quick reply. I appreciate it.

The tracking does happen on the front end (omniture javascript), which
is why I am weary of just stripping it out. Do you believe the approach
of stripping and adding back in the query string is appropriate?

Thanks again,
Travis

On 5/1/2012 6:50 PM, Hugues Alary wrote:
> If the tracking is done via Javascript (like google analytics)
> stripping the query string won't prevent the tracking from happening
> as it will happen on the client browser.
>
> If the tracking happens on the backend, you're out of luck.
>
> On Tue, May 1, 2012 at 4:46 PM, Travis Crowder
> <travis.crowder [at] spechal <mailto:travis.crowder [at] spechal>> wrote:
>
> I am pretty sure the answer to this is: It's not possible; but I
> am hoping to learn something new.
>
> There is a page, let's call it promo.php. We tell a bunch of
> people about it and append their email address to the page for
> tracking ... i.e promo.php?foo [at] bar
>
> I believe in other to cache the page, I need to strip the query
> string (since it will be unique). Is there a way for Varnish to
> cache this page, yet still track the hits? i.e. Strip the query
> string for the lookup and add it back on delivery.
>
> Thanks,
> Travis
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache <mailto:varnish-misc [at] varnish-cache>
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
>
>
> --
> Hugues ALARY


hugues.alary at gmail

May 1, 2012, 5:17 PM

Post #4 of 5 (1063 views)
Permalink
Re: Cache page with dynamic query string [In reply to]

You don't need to put the query string back and even if you do so, it won't
change anything.


GET /promo.php?foo [at] baz GET /promo.php
client -----------------------------------------------> Varnish
-------------------------> backend
/promo.php?foo [at] baz /promo.php
client <---------------------------------------------- Varnish
<-------------------------- backend

On the Varnish side, the url cached is promo.php.
On the client side, the url in the browser bar will stay promo.php?
foo [at] baz and you can access the query string, in javascript.

On Tue, May 1, 2012 at 4:54 PM, Travis Crowder
<travis.crowder [at] spechal>wrote:

> Thanks for your quick reply. I appreciate it.
>
> The tracking does happen on the front end (omniture javascript), which is
> why I am weary of just stripping it out. Do you believe the approach of
> stripping and adding back in the query string is appropriate?
>
> Thanks again,
> Travis
>
>
> On 5/1/2012 6:50 PM, Hugues Alary wrote:
>
> If the tracking is done via Javascript (like google analytics) stripping
> the query string won't prevent the tracking from happening as it will
> happen on the client browser.
>
> If the tracking happens on the backend, you're out of luck.
>
> On Tue, May 1, 2012 at 4:46 PM, Travis Crowder <travis.crowder [at] spechal
> > wrote:
>
>> I am pretty sure the answer to this is: It's not possible; but I am
>> hoping to learn something new.
>>
>> There is a page, let's call it promo.php. We tell a bunch of people
>> about it and append their email address to the page for tracking ... i.e
>> promo.php?foo [at] bar
>>
>> I believe in other to cache the page, I need to strip the query string
>> (since it will be unique). Is there a way for Varnish to cache this page,
>> yet still track the hits? i.e. Strip the query string for the lookup and
>> add it back on delivery.
>>
>> Thanks,
>> Travis
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc [at] varnish-cache
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
>
>
> --
> Hugues ALARY
>
>


--
Hugues ALARY


shib4u at gmail

May 3, 2012, 3:07 AM

Post #5 of 5 (1034 views)
Permalink
Re: Cache page with dynamic query string [In reply to]

#add in vcl_recv

set req.url = regsub(req.url, "(\?|&)$", "");

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.