WP Super Cache
Not to cache a given area (4 posts)

  1. KZKG^Gaara
    Posted 4 years ago #

    My website (http://desdelinux.net) have (like all) header+body+sidebar+footer, I really would like not to cache anything related to the header and sidebar, How I can do this?

    I apologize for my english, is not my primary language.

    Thank you very much to all in advance, I hope someone can help me.

    Best regards.


  2. James Revillini
    Posted 4 years ago #

    You could use <!--dynamic-cached-content-->...<!--/dynamic-cached-content-->

    See the FAQ http://wordpress.org/extend/plugins/wp-super-cache/faq/

    You will also need to use the option "Use PHP to serve cache files."

    I would think this will negatively affect performance pretty dramatically. A better choice would be to use javascript to do whatever 'dynamic' things you are putting in your header and footer. The javascript will be cached, but if the javascript gets data from another resource and embeds it (ajax) then you still have dynamic content.

  3. KZKG^Gaara
    Posted 4 years ago #

    Yes, I already trying with this tags, but has not worked.
    How is it that I should put it?

    Javascript? ... Could you explain a little better please, or to leave a link or something?

    Thank you very much for the help.

  4. James Revillini
    Posted 4 years ago #

    to test using the dynamic-cached-content tag, you'd do something like this in header.php:

    <!--dynamic-cached-content--><?php echo time(); ?><!--
    seconds since unix epoch

    NOTE: there are no spaces between the HTML comments and <?php and ?> tags. The docs say this is important.

    The other way is javascript. For example, in header.php, I might have

    <script src="<?php bloginfo('template_directory'); ?>/dynamic.js">

    and in dynamic.js I might have:

    alert('hello from javascript. it\'s ' + (new Date()));

    this is just a simple example. You can manipulate a page a lot with javascript, so you can hav fun inserting dynamic content anywhere you like. If you have not learned javascript and jQuery, start looking into it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic