WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] possible to disable caching of part of a theme template? (3 posts)

  1. pixeline
    Member
    Posted 1 year ago #

    Hello!
    WP Super Cache is imho the best cache plugin available. That said, i have a specific need and i'd like to know if it is possible to address it as such or if it could be included in a future release.

    Part of a template needs to fetch a specific image according to the current date. Problem is: since the page is cached (it's in a sidebar on all pages), it doesn't do it until the cache is flushed and recreated.

    Would it be possible to "tell" WPSC not to cache a specific part of the template, but do cache the rest, via some kind of easy markup?
    ex:

    <div id="foo"><?php DONOTCACHE_START;?>
    php code / html markup here...
    <? php
    DONOTCACHE_END;
    ?>

    Thanks for all the work you put into this plugin!
    alex.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. thompsonpaul
    Member
    Posted 1 year ago #

    Per the FAQ page for the plugin, there are two ways to accomplish what you're looking for, pixeline:

    How do I make certain parts of the page stay dynamic?

    Note: from version 1.4 this functionality will be disabled by default. You will have to enable it on the settings page.

    There are 2 ways of doing this. You can use Javascript to draw the part of the page you want to keep dynamic. That's what Google Adsense and many widgets from external sites do. Or you can use a WP Super Cache tag to do the job but you can't use mod_rewrite mode caching. You have to switch to PHP or legacy caching.

    The FAQ page has lots more info and some examples of different implementations.

    Hope that helps?

    Paul

  3. pixeline
    Member
    Posted 1 year ago #

    Ah, i missed that info. Thank you Paul !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic