WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] Set it so it does not cache the index.php? (11 posts)

  1. Dracoy
    Member
    Posted 5 years ago #

    WP-Super-Cache is caching http://www.YanyanXu.com index.

    How do I prevent that?

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    You can't. Sorry.

  3. Dracoy
    Member
    Posted 5 years ago #

    Ouch :(

  4. Murmatron 2
    Member
    Posted 5 years ago #

    Create a nocache-home.php in the wp-super-cache/plugins/ directory

    Put this in it...

    <?php
        if($_SERVER['REQUEST_URI'] == '/') $cache_enabled = false;
    ?>

    Should work.

  5. blakekr
    Member
    Posted 5 years ago #

    donncha can you please address this? There are a ton of posts about this problem on this board, and the problem of the newest versions of supercache substituting a category page for index.php at random.

    Also, would you say that you cannot use supercache if you use a static page as the home page? Also what do you think about Murmatron's solution?

  6. teutonika
    Member
    Posted 5 years ago #

    I'd like to join the club:

    I'm unable to figure out how to exclude the home/index.php from cache. The front page shows 'random posts' from archive; therefore the cache should be turned off there.

    As the "index.php" ist not shown in the URL, I can not exclude it in the "Accepted Filenames & Rejected URIs"-Box.

    Any idea?

  7. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Try this in the rejected URI textbox:

    ^/$

    Does that work for you? That should match a single /. If your path is different, add it in if necessary.

  8. teutonika
    Member
    Posted 5 years ago #

    Hi donncha,

    thank you for your quick response and support.
    Placing the exact string ^/$ in the rejected URL box seems to have no effect: the front page still goes into cache.
    When I replace ^ with the path of my blog it actually does block the cache ... unfortunately of the entire blog pages.

    Is there any chance to place a string directly into the index.php to keep it from cache?

    Thank You again.

  9. shoo_ash
    Member
    Posted 5 years ago #

    Hi all,

    I've tried the solution, proposed by Murmatron 2

    Create a nocache-home.php in the wp-super-cache/plugins/ directory

    Put this in it...

    <?php
    if($_SERVER['REQUEST_URI'] == '/') $cache_enabled = false;
    ?>

    Should work.

    This works perfectly for me (having a start page as a static page and using secondary loop).

    Thanks!

    UPD: If it might be of use, before testing I "refreshed" the page by editing to renew it's caching. Now it doesn't get in cache.

  10. teutonika
    Member
    Posted 5 years ago #

    Yes. It works - Great!

    How come I missed Murmatron2s solution? Well, it was late.
    Thank you shoo_ash for your 'reminder'.

  11. Japanac
    Member
    Posted 5 years ago #

    It works... thanks guys :)

    Works here :)

Topic Closed

This topic has been closed to new replies.

About this Topic