Working with custom Headers

You need to be logged in to post messages in the forums. New users may register here.

Norman Leutner

Member since:
09 January 2008

Posts: 40

Friday 20 February 2009 1:20:21 am

Due to some trouble with other installations, I changed







































Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Up

Jérôme Renard

Member since:
06 August 2008

Posts: 22

Friday 20 February 2009 1:21:27 am

Hello Norman,

thanks for the feedback.

I am discussing with Paul on how we could provide some kind of an "official" .vcl file for eZ Publish.

Once we are done with this I think Paul will inform the community.

Cheers :)
Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 19 March 2009 3:48:41 am

I can confirmed that you should not set Expires headers, as they will cause browsers to cache pages as well.

This is some of the settings we use on a site (with squid, but in this regard they behave the same, only Varnish is much better at handling cookies for login status with vcl files like the ones above):





































eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

STEVO +

Member since:
09 January 2008

Posts: 23

Wednesday 22 July 2009 8:39:26 am

Hi,

I've been trying to follow Norman's method for forcing the browser to request again after the user logs in/out.

For me, it didn't work when the user logs out: The browser seems to make the request with "If-Modified-Since" and so varnish returns a 304 Not Modified and the browser uses it's latest cached file which - the logged in version.

I may well have missed something, but I've solved the problem for me by adding:

set req.http.If-Modified-Since = "Mon, 26 Jul 1997 05:00:00 GMT";


to the bottom of sub vcl_recv. Varnish will then lookup + return it's non-logged in cached version + all is well.
Up

Norman Leutner

Member since:
09 January 2008

Posts: 40

Wednesday 22 July 2009 9:31:48 am

Hi Stevo,

you could also drop the header information from ez within the vcl so the client's browser dosen't cache the html requests:












































Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Up

STEVO +

Member since:
09 January 2008

Posts: 23

Wednesday 22 July 2009 2:38:10 pm

Hi Norman,

Thanks, i was pretty sure I tried that (but in vcl_fetch) but perhaps I forgot the pragma. It's easy to run around in circles with this stuff eh?

After 2 days of blindly hacking around I think I've got everything working as I want. I have anonymous users cached, basic users cached with a different hash and advanced users passed right through.

I've also patched the kernel with a little helper function to set a has_user_data cookie if there's anything in the basket or wishlist or particular user/preferences set. I'll have to upload an extension.
Up

STEVO +

Member since:
09 January 2008

Posts: 23

Wednesday 22 July 2009 2:41:23 pm

Oh, I should add a big thank you to everyone that's posted stuff about this varnish stuff + I have to say, it's well worth it in the end!
Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Monday 07 September 2009 3:55:28 pm

Hi there. We'll gonna implement varnish for one of our projects. i will try all your suggestions about .vcl file. Anyway, Jérome was talking about an 'official ez publish varnish configuration'. how is it? Should i try start with this one?

http://svn.projects.ez.no/ezvlogin/tags/ezvlogin-1.1/doc/example.vcl

and then add your suggestions?

Thanks in advanced.

Best regards.
Up

Ekkehard Dörre

Member since:
09 January 2008

Posts: 8

Wednesday 11 November 2009 10:04:59 am

Hi all,

@Jérôme is there any progress in the "official" .vcl file for ez Publish, you mentioned at Friday 20 February 2009 10:21:27 am?

This would be a nice thing,


Greetings, ekke

http://www.coolscreen.de - Over 40 years of eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter released: http://projects.ez.no/cjw_newsletter
Context Sensitive Help in Frontside Editing: http://projects.ez.no/cjw_contexthelp

Up

You need to be logged in to post messages in the forums. New users may register here.