LSCWP, CF cache issue

What is the name of the domain?

What is the error message?

Safari can’t open the page because the network connection was lost

What is the issue you’re encountering

Issue with LSCWP, CF cache and FB for Woocommecre active

What steps have you taken to resolve the issue?

Hello!

We’re experiencing an issue where, on specific devices (iPhone - Safari), the product page fails to load, and Safari returns a “network connection lost” error when navigating to a product page on our WooCommerce site. This issue only occurs when LiteSpeed Cache for WordPress (LSCWP), Cloudflare (CF) cache, and Facebook for WooCommerce (FB for WooCommerce) are all active.

To troubleshoot, I have tested various configurations:

  • LSCWP and CF cache active, FB for WooCommerce disabled: The issue does not occur.
  • CF cache and FB for WooCommerce active, LSCWP disabled: The issue does not occur.
  • LSCWP and FB for WooCommerce active, CF cache disabled: The issue does not occur.

Cloudflare Cache Rules: We have the following cache rules set in Cloudflare:
(http.host contains “mita.si”) and (
((http.cookie contains “woocommerce_cart_hash”) or
(http.cookie contains “woocommerce_items_in_cart”) or
(http.cookie contains “wp_woocommerce_session_”) or
(http.cookie contains “wc_session”) or
(http.cookie contains “wpnonce") or
(http.cookie contains “wp_http_referer") or
(http.cookie wildcard “wp-") or
(http.cookie wildcard "wordpress.
”) or
(http.cookie contains "comment
”) or
(http.cookie wildcard "woocommerce
*”)) or
((http.request.uri contains “/kosarica”) or
(http.request.uri contains “/zakljucek-nakupa”) or
(http.request.uri contains “/moj-racun”) or
(http.request.uri contains “/?add-to-cart=”) or
(http.request.uri contains “/zakljucek-nakupa/order-received/”) or
(http.request.uri contains “/wp-admin/admin-ajax.php”) or
(http.request.uri contains “/wp-json/”) or
(http.request.uri contains “/wp-json/wc/”) or
(http.request.uri contains “/wc-api/”) or
(http.request.uri contains “/callback/”) or
(http.request.uri contains “/prijava-in-registracija/”) or
(http.request.uri contains “/moj-racun/”) or
(http.request.uri contains “/prijava-in-registracija”) or
(http.request.uri contains “wc-ajax=get_refreshed_fragments”) or
(http.request.uri.query contains “wc-ajax”) or
(http.request.uri.query contains “get_refreshed_fragments”))
)

In LSCWP, we have excluded the same cookies, URIs, and query strings from caching.

Do you have any additional suggestions for resolving this issue?

What are the steps to reproduce the issue?

  1. Ensure LSCWP, FB for WooCommerce, and CF caching are all enabled.
  2. Visit our website mita.si.
  3. Navigate to “Vsi Izdelki” (English: “All Products”).
  4. Start opening product pages repeatedly until the issue occurs.

The issue presents as a failure to load the product page, with Safari returning a “network connection lost” message.

Pozdrav iz susjedne :croatia: :wave: :slight_smile:

I’d love to test, however don’t own one. I’ll give it a try with browserstack at least.

From your Cache Rule, it’ll match mita.si and woocommerce_cart_hash, otherwise would match any other OR which doesn’t contain mita.si (might be sub.mita.si as well) with the cookie.

May I ask, with your Cache Rule, if you do cache those pages (kosarica, etc.) as HTML via LSCWP at the origin host, otherwise exluding them from the cache if the cookie is present, rather isn’t? :thinking:

For the Safari, may I ask if the issue when the user is logged-in, or rather normal user searching your Website, adding stuff to the cart and purchasing? :thinking:

Despite your web host, origin, is LiteSpeed, I haven’t used LSCWP and Cloudflare yet.

We might want to wait for someone else who might used it or could help.

Hello @fritex,

Thanks for your reply, i pozdrav! :slight_smile:

I’d love to test, however don’t own one. I’ll give it a try with browserstack at least.

Currently, the CF is disabled (DNS → Proxy → Disable). So the issue cannot be replicated.

From your Cache Rule, it’ll match mita.si and woocommerce_cart_hash , otherwise would match any other OR which doesn’t contain mita.si (might be sub.mita.si as well) with the cookie.

How should I set then that all of the cookies, queries should exclude cache from mita.si?

May I ask, with your Cache Rule, if you do cache those pages (kosarica, etc.) as HTML via LSCWP at the origin host, otherwise exluding them from the cache if the cookie is present, rather isn’t?

The same settings for “exclude cache” i have set it up in the LSCWP cache excludes. So the cart, checkout, woocommecre cookies etc. are excluded from cache in LSCWP.

For the Safari, may I ask if the issue when the user is logged-in, or rather normal user searching your Website, adding stuff to the cart and purchasing?

The issue appears when user was as guest.

Despite your web host, origin, is LiteSpeed, I haven’t used LSCWP and Cloudflare yet.
We might want to wait for someone else who might used it or could help.

I’ve seen similiar post here: CloudFlare Cache Everything - Litespeed LSCache Wordpress

But there was no solution for the problem.

This topic was automatically closed after 15 days. New replies are no longer allowed.