最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to exclude a widget from W3 Total Cache Plugin

programmeradmin2浏览0评论

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.

发布评论