Git Product home page Git Product logo

Comments (10)

colmtroy avatar colmtroy commented on June 12, 2024 1

@centminmod
i think i've figured it out.
I added wc-ajax to the bypass rules in:
wpcacheenabler_mydomain.com.conf

    # bypass cache if URLs containing the following strings
    if ($request_uri ~* "(\?add-to-cart=|\?wc-ajax=|\?wc-api=|/cart/|/my-account/|/checkout/|/shop/checkout/|/wp-json/|/store/checkout/|/customer-dashboard/|/addons/|/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
        set $cache_uri 'nullcache';
    }

not sure why this rule is needed given you already have this a bit further up

    # bypass cache if POST requests or URLs with a query string
    if ($request_method = POST) {
        set $cache_uri 'nullcache';
    }

and the request in question is a post request

698:188.141.52.86 - - [04/May/2021:13:24:03 +0000] "POST /?wc-ajax=get_refreshed_fragments HTTP/2.0" 405 552 "https://snip/product/shorts-with-a-tie-belt/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36"

from centminmod.

centminmod avatar centminmod commented on June 12, 2024 1

Nice troubleshooting! Could be the order of the rules so will add wc-ajax to bypass $request_uri rule too :)

from centminmod.

centminmod avatar centminmod commented on June 12, 2024 1

added fix to 123.09beta01 d29de85 :)

from centminmod.

centminmod avatar centminmod commented on June 12, 2024

which version of cache enabler are you using 1.4.9 or 1.5.1+. If you're using 1.5.1+, tried downgrading to cache enabler 1.4.9 https://community.centminmod.com/threads/add-cache-enabler-1-4-9-legacy-cache-mode-option-in-123-09beta01.20545/ ?

cache enabler 1.5.1+ changed the way they cache for query strings keycdn/cache-enabler#148 so you might want to check with cache enabler support too to see if other folks reporting similar issues at https://wordpress.org/support/plugin/cache-enabler/ and https://github.com/keycdn/cache-enabler/issues

if downgrading to cache enabler 1.4.9 fixes the issue, might want to chime in on keycdn/cache-enabler#148 to make it known 1.5.1+ has issues

from centminmod.

centminmod avatar centminmod commented on June 12, 2024

also does manually clearing cache enabler cache, fix the ?wc-ajax requests temporarily ? or has ?wc-ajax requests always been 405 since day 1?

I ask as once you add something into your cart, the ?wc-ajax request is 200 status as the cookie forces as cache bypass due to presence of woocommerce_items_in_cart=1 cookie AFAIK

image

from centminmod.

colmtroy avatar colmtroy commented on June 12, 2024

hey @centminmod
Sorry I should have led with that info!
I'm running 1.4.9 of Cache Enabler.
I spotted your threads on the big changes to Cache Enabler when I was updating another WP install last week (sidnote: I think the change to caching query strings by default is not going to end well! So many plugins rely on query strings!).
Clearing cache doesn't solve it - it's been like that since Day 1. (this is a brand new machine I just setup over the weekend).

from centminmod.

colmtroy avatar colmtroy commented on June 12, 2024

hey @centminmod
just a quick update on this.
created another brand new machine following the steps listed above and this is still an issue.

from centminmod.

centminmod avatar centminmod commented on June 12, 2024

@colmtroy I'll take a look but I don't have much experience with Woocommerce myself.

from centminmod.

centminmod avatar centminmod commented on June 12, 2024

oh i checked in latest wpcacheenabler_domain.com.conf templates, the POST request bypass is higher up before the bypass URL rules so shouldn't be the case - if you did fresh install it would of been the same case

from centminmod.

colmtroy avatar colmtroy commented on June 12, 2024

Awesome thanks as always @centminmod :)

from centminmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.