WordPress.org

Forums

WP Super Cache
Dont want to cache the frontpage (10 posts)

  1. Henkdekoning
    Member
    Posted 5 years ago #

    Hi, I dont want to cache my frontpage because it should show random posts each time.

    I clicked under Accepted Filenames & Rejected URIs the button Frontpage and added "index" under the Add here strings (not a filename) that forces a page not to be cached.

    But still it caches the frontpage.

    My domain automatically redirects from http://www.xxx.com to http://www.xxx.com/index.php/ with the following code in htaccess:

    RedirectMatch ^/$ /index.php [L]

    and one line code change in canonical.php

    if ( $compare_original !== $compare_redirect ) { $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . '/index.php'; "

    and shows the random posts by (I thought, has been a while) this code:

    <?php
    if (is_home()) {
    query_posts('orderby=rand');
    }
    ?>

    How do I disable caching the frontpage?

  2. Tomahoochi
    Member
    Posted 5 years ago #

    I have the same issue, but it is still serving a random page or post as the homepage instead of the main page.

    I currently have it set to only cache posts, but it appears to be caching everything... index and pages as well.

    I am currently using the development version as DLed yesterday.

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 5 years ago #

    Define the constant DONOTCACHEPAGE in whatever code you have that serves that front page. That will stop the page in question being cached.

  4. Tomahoochi
    Member
    Posted 5 years ago #

    Thanks donncha,

    I actually just got finished doing that.

    On a similar note, what would cause the plugin to show the wrong cached page on the homepage? I would like to have it cached eventually and would like to remedy the problem instead of just avoiding it.

  5. Donncha O Caoimh
    Member
    Plugin Author

    Posted 5 years ago #

    Tom - are you seeing the wrong cached page? I very very occasionally see a problem which is why I added the "extra homepage checks".

  6. Tomahoochi
    Member
    Posted 5 years ago #

    Yes, I see the wrong cached homepage every once in awhile, not all the time though. It does not occur on any other page or post. It happens even when I have the main page checked off as not to be cached in the settings.

    I do have "extra home page checks" clicked.

  7. Donncha O Caoimh
    Member
    Plugin Author

    Posted 5 years ago #

    Tom - have you seen the incorrect page while logged in or logged out? Did you have the homepage checks active when the problem arose?

  8. Tomahoochi
    Member
    Posted 5 years ago #

    I was logged out when I saw them, never when logged in. I have been checking in another browser that is not logged-in to the site.

    Yes, I have had homepage checks active since I installed the plugin and just saw the wrong page as the main page again this morning. I usually just delete the cached page via FTP Commander.

    Thanks for all of the help, I really appreciate it.

  9. Donncha O Caoimh
    Member
    Plugin Author

    Posted 5 years ago #

    OK, Backie found the problem and reported it in another thread. Can you download http://svn.wp-plugins.org/wp-super-cache/trunk/wp-cache.php and place it in your wp-super-cache/ directory? It will overwrite a file of the same name.

    The homepage checks should work now.

  10. Tomahoochi
    Member
    Posted 5 years ago #

    Just did it. I'll turn on homepage caching and see how it acts.

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