2

I am working on a plugin (widget) that is using some transients that are updated from time to time.

That said, when these transients are updated, I think I will need to flush the cache to display the new data properly.

Thus, I wonder if have some way to flush the cache only for widget instead of entire cache. Do you guys have some advice?

1 Answer 1

0

if you want to flush the specific cache you can do that: the plugin has functions for that

<?php
flush_pgcache();  // Page cache
flush_dbcache();  // Database cache
flush_minify();  // Minify cache
flush_all(); // All caches
?>

and you just need to call it like this:

<?php 
$w3_plugin_totalcache->flush_all();
?>
3
  • 1
    Hey, thanks for your reply. However I was not planning to flush entire cache. I wonder if is possible to flush just the widget area. Do you have any ideas? Jan 8, 2014 at 19:11
  • There was no option/function available to flush widget cache. You have to flush_pgcache(); or flush_dbcache(); based your needs.
    – palPalani
    Jan 13, 2014 at 13:19
  • Hey, looks like it is possible to do what I need using Fragment Caching :) Thanks for the help! Jan 26, 2014 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.