janizde / WP-Opening-Hours

Opening Hours Plugin for WordPress
GNU General Public License v2.0
55 stars 16 forks source link

Problem to update open display #126

Closed vince40 closed 4 years ago

vince40 commented 5 years ago

Hello i have one problem to update the "op-is-open" in my website. The display remains blocked as if it were cached and not updated. To fix this problem I need to clean the browser cache or active the cookie plugin in first visite (plugin : Cookie Notice). I can't ask this to the users of my website ;) So, how to prevent caching of your plugin data ? Or another good practice ?? I use wp-rocket for website cache Thank you very much for your help and congratulations for this simple and very useful plugin! Vincent

janizde commented 5 years ago

Hi @vince40 ,

As you mention it "remains blocked as if it were cached and not updated." And this is actually the case when using a caching plugin like wp-rocket. When using a caching plugin you actually trade the dynamics of WordPress against page load speed. So when the cache is created the state of the is open plugin is simply manifested.

To get around this you can try to set your cache lifespan in a way that the cache is always recreated at the start of an hour (assuming that your shop opens and closes at full hours, otherwise you have to lower the granularity). You can take a look at this wp rocket tutorial: https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan

I hope this helps, but there is no integration with caching plugins at the moment

vince40 commented 5 years ago

Hello thank you with a lot of delay ;)