• The plugin does not update popular posts, the plugin gets into the cache to update the displayed list of popular posts, you need to clear the cache … How can I fix this?

Viewing 1 replies (of 1 total)
  • Plugin Author Ajay

    (@ajay)

    Top 10 doesn’t do anything to bypass WSC mainly due

    If you’re looking to do something like that, you will need to do the Advanced settings within WP Super Cache.

    http://svn.wp-plugins.org/wp-super-cache/trunk/plugins/dynamic-cache-test.php

    See also the FAQ:

    Note: this functionality is disabled by default. You will have to enable it on the Advanced 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 and is the recommended way. Or you can use a WP Super Cache filter to do the job but you can’t use mod_rewrite mode caching. You have to use the “simple” delivery method or disable supercaching.

    WP Super Cache 1.4 introduced a cacheaction filter called wpsc_cachedata. The cached page to be displayed goes through this filter and allows modification of the page. If the page contains a placeholder tag the filter can be used to replace that tag with your dynamically generated html.
    The function that hooks on to the wpsc_cachedata filter should be put in a file in the WP Super Cache plugins folder unless you use the late_init feature. An example plugin is included. Edit dynamic-cache-test.php to see the example code.
    There are two example functions there. There’s a simple function that replaces a string (or tag) you define when the cached page is served. The other example function uses an output buffer to generate the dynamic content. Due to a limitation in how PHP works the output buffer code MUST run before the wpsc_cachedata filter is hit, at least for when a page is cached. It doesn’t matter when serving cached pages. See this post for a more technical and longer explanation.
    To execute WordPress functions you must enable the ‘Late init’ feature on the advanced settings page.

    • This reply was modified 7 years, 8 months ago by Ajay.
Viewing 1 replies (of 1 total)

The topic ‘Incorrectly works with WP Super Cache’ is closed to new replies.