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

  1. zombiitv
    Posted 3 years 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.



  2. zombiitv
    Posted 3 years 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 );

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