Hello Rik,

I am having some problems to make Varnish cache my pages (Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0). I know this module's goal is to avoid these problems, but I'd be very thankful if you could confirm my settings are ase they should. I attach an image of my cookies, so you can see if everything is fine.

Thanks a lot

CommentFileSizeAuthor
cookies.jpg200.18 KBalgazaras

Comments

rdeboer’s picture

Title: Problems with Varnish » Optimum Varnish settings for use with Session Cache API

Hi Pablo,

Hmm... don't see anything wrong with the cookies.

Although you do seem to have the Smart IP submodule Device Geolocation switched on. That's not necessary if you have IP Geoloation Views and Maps enabled, which I believe you have. Switching on Smart IP is fine, just not the Device Geolocation submodule. Also no need to use GeoIP and Smart IP together, if you were thinking of doing so-- one of the two, not both.

If the Device Geolocation submodule or any other module on your Drupal install uses the PHP $_SESSION variable, you're stuffed as far as Varnish goes.

I don't have a Varnish environment handy at the moment so maybe someone else can chip-in regarding the best Varnish settings?

Rik

algazaras’s picture

Hi again,

You were right, I had that module enabled. However, disabling it hasn't made disappear the Drupal.session_cache.device_geolocation_attempt

Anyhow, I must find why am I starting the SESS6614d890e33fecb8347af5736ebacb2d session, which I believe is what is preventing Varnish from working. I'll let you know if I find out.

rdeboer’s picture

Hi Pablo,
You need to logout to kill $_SESSION.
Rik

algazaras’s picture

Hi Rik, and thanks again

I don't know why I couldn't see the admin menu in Firefox, and that's why I thought I was logged out.

Now it's working

Best!

rdeboer’s picture

Re #4
Great Pablo,
So would you say that
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
is the perfect config for Varnish?
Anyone want to add anything to it?
Rik

algazaras’s picture

Hi Rik,am using at

No, that was what I got in the Network Response Headers, and it was due to being logged-in.
Now that I visit as an anonymous user I am getting
Cache-Control: public, max-age=3600

which are the settings I am using at admin/config/development/performance

Cheers

kscheirer’s picture

Status: Active » Fixed

Seems resolved?

rdeboer’s picture

@Karl, #7:
It's resolved in that there is no problem.
It is not resolved in the sense that it would be great if some users of this module would share their favorite Varnish configuration settings to use in the context of this module.
Rik

kscheirer’s picture

Status: Fixed » Postponed (maintainer needs more info)

Fair enough. Additional information is welcome!