WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache and user depended parameters inside the html. (6 posts)

  1. sareiodata
    Member
    Posted 4 years ago #

    Hello,

    I've just noticed a "bug" using W3 Total Cache and Thematic.

    Thematic has a very extensive body class. Besides reporting the page you're on (like the category) it also reports the browser (ff3 for example), the operating system (safari, windows, etc). This is very useful because I can use something like: .ie6 #wrapper {} to target browser specific css.

    The thing is that once we cache the site these parameters aren't dynamic anymore and because of that I can't use browser depended CSS. So at times I have css that was written for ie6 loading in firefox.

    So my question is how do we make use of dynamic parameters. I'm not looking for a Thematic specific answer, just a way to have a php function load user depended parameters inside the html.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    So my question is how do we make use of dynamic parameters. I'm not looking for a Thematic specific answer, just a way to have a php function load user depended parameters inside the html.

    There's no bug here. This is the nature of caching. Fragment caching is required to deal with this case and that will be available in the next release.

  3. sareiodata
    Member
    Posted 4 years ago #

    Thanks for the reply. I'll simply disable the page cache (leave the other caches in place) until next version.

  4. Frederick Townes
    Member
    Posted 4 years ago #

    I believe you can use disk basic mode instead and still have some caching benefits.

  5. hifidesign
    Member
    Posted 3 years ago #

    I know this is an old post but my hope is that one of you will see it.

    Frederick, thanks for adding the fragment caching capability. I've had some issues getting it to work, though. Primarily not knowing the proper place to put the fragment code. Admittedly I'm not the most nascent designer when it comes to php.

    Using the FAQ I tried a number of places within my various php functions, but only the second method (below) prevented total breakage of the site.

    <!-- mfunc -->
    <?php
    
        // calling the header.php
        get_header();
    
        // action hook for placing content above #container
        thematic_abovecontainer();
    
    ?>
    <!-- /mfunc -->

    However, I did notice for a brief moment when pages were loading in Chrome and IE that a syntax error was being reported. The pages load normally, but still with the cached version of the theme file containing the body class of the most frequently used, and therefore cached, browser.

    sareiodata, by any chance have you figured out how to do that or found a way around it in standard settings?

  6. casabsolute
    Member
    Posted 3 years ago #

    Had the same issue here - Thematic body browser classes being cached and breaking my browser-targeted (*cough* IE) CSS. I tried changing the Page Cache to disk basic mode, but that didn't work : I had to completely disable Page Cache. :( If anyone has a workaround that will allow for Page Cacheing but not cache Thematic body browser classes, I'm all ears.

Topic Closed

This topic has been closed to new replies.

About this Topic