Sign up ×

I'd love to use »W3 Total Cache« for my Wordpress page. Caching the full page is really fasten up the site. But there is a lot of current community activity and most pages including some "latest comments" or "new notifications" parts (self made boxes in template, not sidebar widgets)

How can i be sure that only these parts of the page are up to date while the rest can stay in cache as long as i don't empty it? Whats a good workaround?

Building thoses Boxes with AJAX?

Hope i could explain myself... thanks a lot.

share|improve this question
You can not cache a part of dynamically generated page. The meaning of caching is to save static version of the page and to serve it to the user. And yes, AJAX is the solution as it's generated on the user side. –  Max Yudin Mar 7 '13 at 10:07

1 Answer 1

You can use following code to exclude page from caching.

define('DONOTCACHEPAGE', true);
//Disables page caching for a given page.
define('DONOTCACHEDB', true);
//Disables database caching for given page.
define('DONOTMINIFY', true);
//Disables minify for a given page.
define('DONOTCDN', true);
//Disables content delivery network for a given page.
define('DONOTCACHCEOBJECT', true);
//Disables object cache for a given page

and to exclude particular functions or lines of code include it in foolwing syntax of mfunc.

 //Example 1:
<!-- mfunc any PHP code --><!-- /mfunc -->
//Example 2:
<!-- mfunc -->any PHP code<!-- /mfunc -->
//Example 3:
<!--MFUNC           -->
                                  echo rand();
<!--/mfunc -->
//Example 4:
<!-- mclude path/to/file.php --><!-- /mclude -->
//Example 5:
<!-- mclude -->path/to/file.php<!-- /mclude -->
share|improve this answer

Your Answer


