WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache - three questions (4 posts)

  1. nonenoknow
    Member
    Posted 1 year ago #

    Hi there,

    I am a bit of a newby, so excuse my "everyday language" when it comes to the problems/issues. I am using W3 Total Cache and thus far it works fine.

    1) However, I am not getting the part of "fragmented caching". I want one single widget, called "TimeZoneCalculator" (v 2.44 - JavaScript) to not get cached, as it will show the times delayed then. But where exactly do I have to put the <!-- mfunc any PHP code --><!-- /mfunc --> code? Does it at all work with JS?

    2) Only my front page gets gzip compression, no other pages? Why?

    3) I want one category in my blog (namely "News") not to get cached at all, as my news are coming in on a ad-hoc (minute) basis. How to achieve this?

    Thanks a lot
    Christian

  2. slith
    Member
    Posted 1 year ago #

    From what I understand.

    1) If by "widget" you are referring to a WordPress widget, you cant do this. With page caching the wordpress engine is totally bypassed.

    However, if you can modify the widget code, you can do something like this:

    <!-- mfunc echo "This is the time not cached " . time(); --><?php echo "This is the time cached" . time(); ?><!-- /mfunc -->

    More info: http://www.lost-in-code.com/platforms/wordpress/w3tc-fragment-caching-mfunc

    3)

    You can do something like this in your functions.php

    add_action('wp_head', 'define_if_page_cache');
    
    function define_if_page_cache() {
        if (is_category("News")) {
            define('DONOTCACHEPAGE', true);
        }
    }
  3. nonenoknow
    Member
    Posted 1 year ago #

    Hi slith,

    thanks for your resoponse. Plugin deleted, as without being able to not cache specific parts of the the site, like widgets, it makes absolutely no sense for me.

    Cheers
    Christian

  4. slith
    Member
    Posted 1 year ago #

    You can tell it to not cache a section of the site, just not if the widget needs to be not cached and needs the wordpress engine loaded.

    You can still always use Object & SQL cacheing.

Topic Closed

This topic has been closed to new replies.

About this Topic