Mailing List Archive

varnish caching with jsessionid being set
Hello,

I'm fairly new to varnish and have used it successfully in the past. Here
they would like to use it but they have jsessionid tracking thru multiple
VIPs. It seems that these jsessionids are being called cookies and I'm not
able to cache anything.

Is there a way to use the jsessionids and accomplish the caching?

Thanks,
Jim

--
*James Louis*
*Lead Systems Engineer*



4400 Baker Road, Minnetonka, MN 55343<br>
CELL 612.203.2631
TOLL FREE 888-346-3486 x 622 | FAX 952-908-6129
http://www.peoplenetonline.com

PeopleNet is the leading provider of fleet mobility systems to the
transportation industry, including truckload, LTL, private, and energy
service fleets.
Re: varnish caching with jsessionid being set [ In reply to ]
On Wed, Mar 15, 2017 at 6:30 PM, Jim Louis <jlouis@peoplenetonline.com> wrote:
>
> Hello,
>
> I'm fairly new to varnish and have used it successfully in the past. Here they would like to use it but they have jsessionid tracking thru multiple VIPs. It seems that these jsessionids are being called cookies and I'm not able to cache anything.
>
> Is there a way to use the jsessionids and accomplish the caching?

Hello,

Yes, there is. This is by far my "favorite" topic [1] so I wrote a
blog post [2] about it. I would recommend carefulness and a solid
understanding of HTTP and cookies first. It also depends a lot on
whether your backend speaks proper HTTP and won't (mis)lead
Varnish to do TheWrongThing(tm).

Cheers,
Dridi

[1] just in case it wasn't clear, it's not
[2] https://info.varnish-software.com/blog/yet-another-post-on-caching-vs-cookies

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: varnish caching with jsessionid being set [ In reply to ]
Dridi,

I must not be understanding your example on [2] as I'm still getting
everything passed.

The BereqHeader in varnishlog -b shows:
BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204;
pfmhelp=1; _ga=GA1.2.1694534677.1489779146;
TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4; navigation=520533110%7C4130

and I'm seeing:
BerespHeader Cache-Control: no-cache, no-store, must-revalidate
BerespHeader Pragma: no-cache

Also, was there a part 2 to that blog?

Thanks,
Jim

On Thu, Mar 16, 2017 at 7:56 AM, Dridi Boukelmoune <dridi@varni.sh> wrote:

> On Wed, Mar 15, 2017 at 6:30 PM, Jim Louis <jlouis@peoplenetonline.com>
> wrote:
> >
> > Hello,
> >
> > I'm fairly new to varnish and have used it successfully in the past.
> Here they would like to use it but they have jsessionid tracking thru
> multiple VIPs. It seems that these jsessionids are being called cookies and
> I'm not able to cache anything.
> >
> > Is there a way to use the jsessionids and accomplish the caching?
>
> Hello,
>
> Yes, there is. This is by far my "favorite" topic [1] so I wrote a
> blog post [2] about it. I would recommend carefulness and a solid
> understanding of HTTP and cookies first. It also depends a lot on
> whether your backend speaks proper HTTP and won't (mis)lead
> Varnish to do TheWrongThing(tm).
>
> Cheers,
> Dridi
>
> [1] just in case it wasn't clear, it's not
> [2] https://info.varnish-software.com/blog/yet-another-post-on-
> caching-vs-cookies
>



--
*James Louis*
*Lead Systems Engineer*



4400 Baker Road, Minnetonka, MN 55343<br>
CELL 612.203.2631
TOLL FREE 888-346-3486 x 622 | FAX 952-908-6129
http://www.peoplenetonline.com

PeopleNet is the leading provider of fleet mobility systems to the
transportation industry, including truckload, LTL, private, and energy
service fleets.
Re: varnish caching with jsessionid being set [ In reply to ]
On Fri, Mar 17, 2017 at 8:46 PM, Jim Louis <jlouis@peoplenetonline.com> wrote:
>
> Dridi,
>
> I must not be understanding your example on [2] as I'm still getting everything passed.

Hi Jim,

Thanks for letting me know, I will try to clarify this part.

> The BereqHeader in varnishlog -b shows:
> BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204; pfmhelp=1; _ga=GA1.2.1694534677.1489779146; TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4; navigation=520533110%7C4130
>
> and I'm seeing:
> BerespHeader Cache-Control: no-cache, no-store, must-revalidate
> BerespHeader Pragma: no-cache

The backend is telling Varnish, and ultimately the client, that the
response cannot be cached. Depending on your version of Varnish
it will indeed result in subsequent passed transaction.

> Also, was there a part 2 to that blog?

Part 2 is written, but still an early draft so not published yet.

Cheers,
Dridi

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: varnish caching with jsessionid being set [ In reply to ]
Thanks Dridi!

On Mon, Mar 20, 2017 at 3:09 AM, Dridi Boukelmoune <dridi@varni.sh> wrote:

> On Fri, Mar 17, 2017 at 8:46 PM, Jim Louis <jlouis@peoplenetonline.com>
> wrote:
> >
> > Dridi,
> >
> > I must not be understanding your example on [2] as I'm still getting
> everything passed.
>
> Hi Jim,
>
> Thanks for letting me know, I will try to clarify this part.
>
> > The BereqHeader in varnishlog -b shows:
> > BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204;
> pfmhelp=1; _ga=GA1.2.1694534677.1489779146; TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4;
> navigation=520533110%7C4130
> >
> > and I'm seeing:
> > BerespHeader Cache-Control: no-cache, no-store, must-revalidate
> > BerespHeader Pragma: no-cache
>
> The backend is telling Varnish, and ultimately the client, that the
> response cannot be cached. Depending on your version of Varnish
> it will indeed result in subsequent passed transaction.
>
> > Also, was there a part 2 to that blog?
>
> Part 2 is written, but still an early draft so not published yet.
>
> Cheers,
> Dridi
>



--
*James Louis*
*Lead Systems Engineer*



4400 Baker Road, Minnetonka, MN 55343<br>
CELL 612.203.2631
TOLL FREE 888-346-3486 x 622 | FAX 952-908-6129
http://www.peoplenetonline.com

PeopleNet is the leading provider of fleet mobility systems to the
transportation industry, including truckload, LTL, private, and energy
service fleets.
Re: varnish caching with jsessionid being set [ In reply to ]
Dridi,

Supposedly, nginx has the ability to ignore the caching headers. Does
Varnish provide a similar mechanism?

Thanks,
Jim

On Mon, Mar 20, 2017 at 3:09 AM, Dridi Boukelmoune <dridi@varni.sh> wrote:

> On Fri, Mar 17, 2017 at 8:46 PM, Jim Louis <jlouis@peoplenetonline.com>
> wrote:
> >
> > Dridi,
> >
> > I must not be understanding your example on [2] as I'm still getting
> everything passed.
>
> Hi Jim,
>
> Thanks for letting me know, I will try to clarify this part.
>
> > The BereqHeader in varnishlog -b shows:
> > BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204;
> pfmhelp=1; _ga=GA1.2.1694534677.1489779146; TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4;
> navigation=520533110%7C4130
> >
> > and I'm seeing:
> > BerespHeader Cache-Control: no-cache, no-store, must-revalidate
> > BerespHeader Pragma: no-cache
>
> The backend is telling Varnish, and ultimately the client, that the
> response cannot be cached. Depending on your version of Varnish
> it will indeed result in subsequent passed transaction.
>
> > Also, was there a part 2 to that blog?
>
> Part 2 is written, but still an early draft so not published yet.
>
> Cheers,
> Dridi
>



--
*James Louis*
*Lead Systems Engineer*



4400 Baker Road, Minnetonka, MN 55343<br>
CELL 612.203.2631
TOLL FREE 888-346-3486 x 622 | FAX 952-908-6129
http://www.peoplenetonline.com

PeopleNet is the leading provider of fleet mobility systems to the
transportation industry, including truckload, LTL, private, and energy
service fleets.
Re: varnish caching with jsessionid being set [ In reply to ]
Sure, you can override them:

set vcl_backend_response {
set beresp.ttl = 5m;
}

--
Guillaume Quintard

On Tue, Mar 21, 2017 at 4:11 PM, Jim Louis <jlouis@peoplenetonline.com>
wrote:

> Dridi,
>
> Supposedly, nginx has the ability to ignore the caching headers. Does
> Varnish provide a similar mechanism?
>
> Thanks,
> Jim
>
> On Mon, Mar 20, 2017 at 3:09 AM, Dridi Boukelmoune <dridi@varni.sh> wrote:
>
>> On Fri, Mar 17, 2017 at 8:46 PM, Jim Louis <jlouis@peoplenetonline.com>
>> wrote:
>> >
>> > Dridi,
>> >
>> > I must not be understanding your example on [2] as I'm still getting
>> everything passed.
>>
>> Hi Jim,
>>
>> Thanks for letting me know, I will try to clarify this part.
>>
>> > The BereqHeader in varnishlog -b shows:
>> > BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204;
>> pfmhelp=1; _ga=GA1.2.1694534677.1489779146;
>> TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4; navigation=520533110%7C4130
>> >
>> > and I'm seeing:
>> > BerespHeader Cache-Control: no-cache, no-store, must-revalidate
>> > BerespHeader Pragma: no-cache
>>
>> The backend is telling Varnish, and ultimately the client, that the
>> response cannot be cached. Depending on your version of Varnish
>> it will indeed result in subsequent passed transaction.
>>
>> > Also, was there a part 2 to that blog?
>>
>> Part 2 is written, but still an early draft so not published yet.
>>
>> Cheers,
>> Dridi
>>
>
>
>
> --
> *James Louis*
> *Lead Systems Engineer*
>
>
>
> 4400 Baker Road, Minnetonka, MN 55343<br>
> CELL 612.203.2631 <(612)%20203-2631>
> TOLL FREE 888-346-3486 x 622 <(888)%20346-3486> | FAX 952-908-6129
> <(952)%20908-6129>
> http://www.peoplenetonline.com
>
> PeopleNet is the leading provider of fleet mobility systems to the
> transportation industry, including truckload, LTL, private, and energy
> service fleets.
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
RE: varnish caching with jsessionid being set [ In reply to ]
Can you also add the set beresp.grace parameter as well right after the ttl
From: varnish-misc-bounces+rbizzell=measinc.com@varnish-cache.org [mailto:varnish-misc-bounces+rbizzell=measinc.com@varnish-cache.org] On Behalf Of Guillaume Quintard
Sent: Wednesday, March 22, 2017 11:29 AM
To: Jim Louis <jlouis@peoplenetonline.com>
Cc: varnish-misc <varnish-misc@varnish-cache.org>
Subject: Re: varnish caching with jsessionid being set

Sure, you can override them:

set vcl_backend_response {
set beresp.ttl = 5m;
}

--
Guillaume Quintard

On Tue, Mar 21, 2017 at 4:11 PM, Jim Louis <jlouis@peoplenetonline.com<mailto:jlouis@peoplenetonline.com>> wrote:
Dridi,

Supposedly, nginx has the ability to ignore the caching headers. Does Varnish provide a similar mechanism?

Thanks,
Jim

On Mon, Mar 20, 2017 at 3:09 AM, Dridi Boukelmoune <dridi@varni.sh<mailto:dridi@varni.sh>> wrote:
On Fri, Mar 17, 2017 at 8:46 PM, Jim Louis <jlouis@peoplenetonline.com<mailto:jlouis@peoplenetonline.com>> wrote:
>
> Dridi,
>
> I must not be understanding your example on [2] as I'm still getting everything passed.

Hi Jim,

Thanks for letting me know, I will try to clarify this part.

> The BereqHeader in varnishlog -b shows:
> BereqHeader Cookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204; pfmhelp=1; _ga=GA1.2.1694534677.1489779146; TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4; navigation=520533110%7C4130
>
> and I'm seeing:
> BerespHeader Cache-Control: no-cache, no-store, must-revalidate
> BerespHeader Pragma: no-cache

The backend is telling Varnish, and ultimately the client, that the
response cannot be cached. Depending on your version of Varnish
it will indeed result in subsequent passed transaction.

> Also, was there a part 2 to that blog?

Part 2 is written, but still an early draft so not published yet.

Cheers,
Dridi



--
James Louis
Lead Systems Engineer

[Image removed by sender.]

4400 Baker Road, Minnetonka, MN 55343<br>
CELL 612.203.2631<tel:(612)%20203-2631>
TOLL FREE 888-346-3486 x 622<tel:(888)%20346-3486> | FAX 952-908-6129<tel:(952)%20908-6129>
http://www.peoplenetonline.com

PeopleNet is the leading provider of fleet mobility systems to the transportation industry, including truckload, LTL, private, and energy service fleets.

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org<mailto:varnish-misc@varnish-cache.org>
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



This email (including any attachments) may contain confidential information intended solely for acknowledged recipients. If you think you have received this information in error, please reply to the sender and delete all copies from your system. Please note that unauthorized use, disclosure, or further distribution of this information is prohibited by the sender. Note also that we may monitor email directed to or originating from our network. Thank you for your consideration and assistance. |
Re: varnish caching with jsessionid being set [ In reply to ]
On Wed, Mar 22, 2017 at 4:28 PM, Guillaume Quintard
<guillaume@varnish-software.com> wrote:
>
> Sure, you can override them:
>
> set vcl_backend_response {
> set beresp.ttl = 5m;
> }

Hello Jim,

This kind of "yes you can" should always come with a mandatory
"but you shouldn't" :)

C allows you to easily shoot yourself in the foot, C++ too but it will
blow off your whole leg. Those are well known facts.

It is the same for VCL: it allows you to shoot yourself in the foot,
blow off your leg, and leak sensitive information. That is true
with any caching solution that allows you to overrule the origin
server. And that applies to any origin server that doesn't do
proper caching.

If you're backend isn't good at conveying caching intent, fix the
backend. Otherwise how can you know when you (and I quote)
"ignore the caching headers" that you aren't caching something
private?

Know what thou art doing and proceed with care.

Dridi

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
RE: varnish caching with jsessionid being set [ In reply to ]
I want to make sure if my backend goes down that the content will still be served until the backend comes back up
-----Original Message-----
From: Dridi Boukelmoune [mailto:dridi@varni.sh]
Sent: Friday, March 24, 2017 8:41 AM
To: Rodney Bizzell <rbizzell@measinc.com>
Subject: Re: varnish caching with jsessionid being set

On Fri, Mar 24, 2017 at 1:35 PM, Rodney Bizzell <rbizzell@measinc.com> wrote:
> Is it okay to set the set beresp.grace after the set beresp.ttl = 5m;

It is, but it mainly depends on what you are trying to achieve. Don't forget to CC the mailing list next time.


This email (including any attachments) may contain confidential information intended solely for acknowledged recipients. If you think you have received this information in error, please reply to the sender and delete all copies from your system. Please note that unauthorized use, disclosure, or further distribution of this information is prohibited by the sender. Note also that we may monitor email directed to or originating from our network. Thank you for your consideration and assistance. |
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc