-2

The App:

I am running a WordPress WooCommerce website and did some modifications.

Users arrive at a page called /configurator/ where they get asked different questions. After answering all questions I lead the users to a page /summary/ .

On this /summary/ page an individual result is presented to the user based on their answers in the /configurator/. Also I create a cookie on /configurator/ with all answers.

I use the cookie also on /cart/ and /checkout/ to add individual information to the product we sell to the user.

The Problem: When we went live with the website we turned on "production mode" for our website at the admin panel of our hoster. It basically turns on the CDN and enables caching. Unfortunately users experienced problems on /summary/. It seemed that the page couldn't be loaded.

My analysis: I think the hoster caches /summary/ and breaks my site. Following this article it makes sense that the site doesn't work any more: https://docs.woocommerce.com/document/configuring-caching-plugins/

„These pages need to stay dynamic since they display information specific to the current customer.“

What the hoster says: The hoster says they cannot exclude any subpages from being cached: "The problem was caused by coding errors in combination with the cookies that we create on /summary/"

Current Status: I need to leave the site in development mode (without CDN and cache) which is very slow. Based on what the hoster says I can't turn on production mode because it will probably break the site again and we lose a lot of money. Currently I cant reproduce the error on a cloned version of the site :(

Ben Spi
  • 756
  • 1
  • 9
  • 23
  • So it’s either a coding error or you need a new hosting company. Is that what you’re thinking? Could you include some of the code so we can rule out that part anyway? – Derek Nolan Oct 26 '17 at 23:44
  • @DerekNolan : thanks for your quick answer. It's a big piece of code so I don't think this would be super helpful here. My basis question is: If the cache my /summary/ page: Can my app work at all? – Ben Spi Oct 26 '17 at 23:57
  • Do you think I can use this: https://stackoverflow.com/questions/13640109/how-to-prevent-browser-cache-for-php-site ? – Ben Spi Oct 27 '17 at 00:01
  • I don’t see why your site wouldn’t work with caching. What I was wondering was whether the cookie (which sounds like the culprit) was necessary. I would have used £_POST to pass information around. – Derek Nolan Oct 27 '17 at 00:10

1 Answers1

0

You should rewrite your code and instead of using cookies use WC Sessions. Every customer has a session that already works and persists throughout the whole site, just set your data in it and use it at all pages you need.