admin管理员组

文章数量:1317906

I am using a currency widget to show live currencies for different countries. I also use W3 Total Cache plugin and the widget data is cached. For example yesterday's prices are shown for today and I have to manually purge all caches to get the new data.

Is there anyway to disable cache for certain widgets? or clear the cache every hour for that widget?

I am using a currency widget to show live currencies for different countries. I also use W3 Total Cache plugin and the widget data is cached. For example yesterday's prices are shown for today and I have to manually purge all caches to get the new data.

Is there anyway to disable cache for certain widgets? or clear the cache every hour for that widget?

Share Improve this question asked Dec 6, 2016 at 22:48 SamSam 112 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

You need to use fragment caching so enable PHP in the widget and then use the following tags:

<!-- mfunc --> 

The following links should help:

https://wordpress/support/topic/using-shortcodes-with-fragment-caching/ https://www.justinsilver/technology/wordpress/w3-total-cache-fragment-caching-wordpress/

The recommended solution is to have your currency widget refresh its data via ajax.

本文标签: phpHow to exclude a widget from W3 Total Cache Plugin