WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] Manually Cache Pages (2 posts)

  1. zombiitv
    Member
    Posted 1 year ago #

    I just upgraded from 0.9.9 to 1.2.

    When I visit a page, everything is cached like it is supposed to; however, I have a custom script that I use to control what pages get cached and when. In this script I make the following call:

    do_action( 'gc_cache', 'rebuild', 'homepage' );

    I get this: <!-- Page not cached by WP Super Cache. Blank Page. Check output buffer usage by plugins. -->

    I have tried several variations on the URL but nothing is working. This worked fine in version 0.9.9, what changed?

    In the debug log, I get a bunch of messages saying that the buffer is blank - looks like the do_action call is not loading the page.

    Thanks

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

  2. zombiitv
    Member
    Posted 1 year ago #

    Total hack but this works. Instead of calling the action I'm just calling file_get_content($url). This will load the page from cache if it's already built or build a new one if it isn't (just like if you visited the page), if you want it to replace an old page, you'll need to call prune first. I.E.

    prune_super_cache( $cache_path . 'supercache/' . $postURL . 'index.html', true, true );
    prune_super_cache( $cache_path . 'supercache/' . $postURL . 'index.html.gz', true, true );
    file_get_contents($postURL);

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags