WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Force WP-Cache to refresh home page? (4 posts)

  1. marke1
    Member
    Posted 7 years ago #

    Anybody know how to make WP-Cache force itself to refresh its cache of the blog's home page?

    Seems as though refreshing a post or page is easy enough, but the home page, I haven't tracked down yet.

    Any ideas?

  2. iscifi
    Member
    Posted 7 years ago #

    the homepage is index.php which also reads the posts and pumps it through the filters, plugins , themes etc. So in reality it should all ready update the cache for the home page, also if the content of the home pages doesnt change, the cache isn't changed.

    whats the URL you are talking about??

  3. marke1
    Member
    Posted 7 years ago #

    Ya, I know all that.

    I need to refresh it myself because there is some Ajax and other Javascript that needs to work on specific $_SERVER variables when a browser lands on the home page to stuff content into a div. So in that case, using a cached copy of the home page doesn't work because the home page is built differently for particular visitors. New plugin...

  4. marke1
    Member
    Posted 7 years ago #

    Found the answer, it's easy.

    http://mnm.uib.es/gallir/wp-cache-2/

    Posted here for future reference should others come looking for the solution:

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

    It’s compatible with Staticze Reloaded. From their FAQ:

    There are two ways to do this, you can have functions that say dynamic or include entire other files. To have a dynamic function in the cached PHP page use this syntax around the function:

    <!--mfunc function_name('parameter', 'another_parameter') -->
    <?php function_name('parameter', 'another_parameter') ?>
    <!--/mfunc-->`

    The HTML comments around the mirrored PHP allow it to be executed in the static page. To include another file try this:

    <!--mclude file.php-->
    <?php include_once(ABSPATH . 'file.php'); ?>
    <!--/mclude-->`

    That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.