nexcess / magento-turpentine

A Varnish extension for Magento.
GNU General Public License v2.0
519 stars 253 forks source link

crawlers vs. humans catch 22 #1259

Closed Schoeny1 closed 7 years ago

Schoeny1 commented 8 years ago

Love the extension though I am stuck in a catch 22 situation. If I apply the Use VCL Fix setting then the cache warmer does not work. But it will cache actual user activity.
For example, crawler hits page1.html but I try it in a browser and it is not cached.
But if I browse the page myself and try in a new browser the page is cached.

If I turn the setting off, then the crawler warms the site beautifully. But then there is a cookie issue with logging into the site. For example: I load any front-end page running varnish. I then switch to the login page which is non-Varnish and attempt to login....... the page reloads as if I did not login. The weird thing is that it sort of logged me in and I get a weird message at checkout.

But if I skip the front-end and go directly to the login page everything works normal.

Is this a known Turpentine catch 22 with cookies?

I have read numerous issues that sound similar but no solution. Site is Magento 1.9.2.3 and latest version of Turpentine. I have several sites running different versions and it happens on all of them.

Thanks in advance!

aricwatson commented 8 years ago

Love the extension though I am stuck in a catch 22 situation. If I apply the Use VCL Fix setting then the cache warmer does not work. But it will cache actual user activity.

Do you mean the cache warming script or the built-in warmer? If you mean the script, check out the version in the devel branch - it'll let you select the UserAgent you want to use when warming. This is most likely where your problem is coming from - the warmer runs with a different UA than typical users browsing the site, and if you have "User-Agent Normalization" turned on, this will be a problem.

I load any front-end page running varnish. I then switch to the login page which is non-Varnish and attempt to login....... the page reloads as if I did not login. The weird thing is that it sort of logged me in and I get a weird message at checkout.

Hmm, and this is with the observer method being used, not VCL fix? It sounds like a formkey issue...

Schoeny1 commented 8 years ago

Thanks, I am running the cache-warmer script but I will check out the version in the devel branch. As for the login issue, it only occurs when the VCL fix is not applied. It only happens with Turpentine and not when just plain Varnish is running. I am fine with having the VCL fix applied as long as I can get the cache-warmer script to work with that setting applied. I will give the devel branch a shot and post back.