0 votes
21 views
by Rookie

Hi! I just moved from Easy Engine and I'm loving Webinoly so far, though I'm having an issue with the Easy Digital Downloads checkout being cached.

I can't seem to skip the cache on checkout. The products stay there for everyone across everything.

It's also worth mentions I'm properly a noob at Nginx

Here's what I've added to to my custom-nginx.conf under /var/www/mydomain.com

if ($request_uri ~* "/cart.*/|/my-account.*|/checkout.*|/purchase-confirmation.*|/edd-sl.*|/login/") {         

set $skip_cache 1;

}

if ($http_cookie ~* “ edd_items_in_cart |comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in”) {

set $skip_cache 1;

}

When I access /checkout/ while viewing the logs, it states bypass which is expected? Though it still displays the cached products.

I also need the /edd-sl.* (for software licensing) not to be cached. I haven't checked this out yet.

I'm also securing EDD downloads with this:

rewrite ^/wp-content/uploads/edd/(.*)\.zip$ / permanent;

is $skip_cache being used before my custom config? or am I missing something?
I'm keeping cache off for now. Any point in the right direction or tips would be highly appreciated! Thank you!

Bonus

For those who's using The SEO Framework line me. I noticed the sitemap couldn't be accessed. I found this code which works well from my custom config.

## sitemap location = /sitemap.xml { rewrite ^/sitemap.xml$ "/?the_seo_framework_sitemap=xml" permanent; }

1 Answer

0 votes
by Expert

Hi Morgan,

I've never used EDD, so I don't really know what exactly you need to bypass the cache. What I can suggest is that you can see the rules we use for WooCommerce, please check the /etc/nginx/common/wpfc.conf file.

Also, remember that Webinoly has native support for Yoast Sitemap, you can enable/disable this feature whenever you want, just be careful to not have a conflict with your custom sitemap rules.

Regards.

by Rookie

I've been test this every way I know how and modified the /etc/nginx/common/wpfc.conf  with the same result. 

It still states 'bypassed' as expected, so it must be being cached somewhere else. Could Redis be caching the cart separately? 

The Yoast Sitemap settings in Webinoly seems to have no no affect on the SEO Framework sitemap. It's a fast growing SEO plugin, it would be cool if you'd consider supporting it by default :) 

Thank you for your time.

by Rookie

I just noticed this in my WordFence logs, when I clear the cart from multiple browsers. 

left https://mydomain.com/checkout/?edd_remove_from_cart_nonce=17dfa1287b and was redirected when visiting https://mydomain.com/checkout/?edd_remove_from_cart_nonce=c5634013e1

When cache is enabled it redirects all browsers to use the same nonce (c5634013e1), which is why the cart appears to work like a 'global cart'.

Let me know if you have any pointers for dealing with nonces when it comes to cache config. 

Thanks!

by Expert
Did you already try with Redis disabled?
Welcome to the Community site for Webinoly.

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

News: Webinoly now install PHP 7.3 by default.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...