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 badges2 Answers
Reset to default 1You 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.