WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache super caching index.php (22 posts)

  1. adventmidi
    Member
    Posted 5 years ago #

    Hi all,

    I'm just learning about the wonders of WP Super Cache and for the most part it's working great, but when I enable Super Cache (ON mode) it caches the index page which and the front page of the blog doesn't refresh. I have index.php in the rejected URI field, but it's still doing it.

    Does anyone know how to solve this?

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    There's something strange going on there.
    How do you normally post to your blog? Through the dashboard Write page? an Offline Writer like Ecto or WLW?
    Do you use future posting?
    Is your WordPress installed in the same directory you're serving the site from?

  3. adventmidi
    Member
    Posted 5 years ago #

    I post on my blog several times a day, but none of the posts were showing up when I had WP Super Cache in "On mode". I use an offline writer, Windows Live Writer to write my posts. I haven't tried using future posting.

    WordPress is installed in /public_html/wordpress

  4. Donncha O Caoimh
    Member
    Posted 5 years ago #

    adventmidi - do you access your blog at http://example.com/wordpress/ or http://example.com/ ?

  5. Hiranthi
    Member
    Posted 5 years ago #

    It's caching my index-page too. I've added index.php and home.php (that's the template file I'm using for my index-page) to the rejected files but it's still caching them..
    Seeing I have a random image-header and a RSS-feed on that page it's kinda annoying (url is http://www.illutic.nl btw, the site is in Dutch).

  6. adventmidi
    Member
    Posted 5 years ago #

    doncha - I'm accessing my blog at http://www.example.com, but wordpress is at http://example.com/wordpress.

  7. hemasunder
    Member
    Posted 5 years ago #

    dear doncha,
    thanks for the plugin.
    it is working fine for me
    but after moving my account to dedicated it's caching my index.php,
    and some other dynamic pages like gallery.php,
    my domain is example.com,, and wordpress installed in example.com/english

    my .htaccess file in example.com/english

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*p=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/english/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /english/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*p=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/english/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /english/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
    # END WPSuperCache
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    and in example.com

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    Options All -Indexes

    can you tell me the solution please

  8. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Grab the development version from http://wordpress.org/extend/plugins/wp-super-cache/download/ as I've just checked in a fix that should fix this.

  9. Casey Picker
    Member
    Posted 5 years ago #

    I've downloaded the DEV version and it's still caching my home.php template page, even after clearing my cache. Any ideas?

    http://www.lamplightmedia.net

  10. Casey Picker
    Member
    Posted 5 years ago #

    Ok, I've tried to hack this plugin myself so that it won't cache my home page. In wp-cache-phase2.php I've edited line 63 to the following:

    if (strstr($uri, '/wp-admin/') || $uri == "http://www.lamplightmedia.net/" || $uri == "http://www.lamplightmedia.net")

    I'm still not having any luck with this. The plugin is still caching my homepage, as I still see the wp-cache notification in the source of the page. Any ideas?

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    I don't quite understand why you'd want it to not cache the front page of the site. Since that's the one that gets the most hits, that's the one that you want cached the most.

    Anyway, version 0.8.1 adds an option to "Clear all cache files when a post or page is edited." That will force it to refresh when you change things.

  12. Casey Picker
    Member
    Posted 5 years ago #

    I've got a rotating image that is using the php rand function to display a different image every time the page is loaded. When it's cached, the same image is always displayed. That's why I don't want the front page to be cached.

  13. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Is that the only reason? Yikes. What a pain.

    Use a javascript to randomize the image displayed instead of PHP code.

    http://www.google.com/search?q=javascript+image+random

  14. Casey Picker
    Member
    Posted 5 years ago #

    I really didn't want to do it in javascript, but I guess that's my only option this point. Oh well...

  15. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    I really didn't want to do it in javascript

    Why not? That would be the best way to do it, really.

  16. Casey Picker
    Member
    Posted 5 years ago #

    Not necessarily. If a user doesn't have javascript enabled, then nothing would show up, and Javascript is not standards compliant...

  17. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Nah. Think harder. Use javascript with a non-scripting fallback.

    <!-- in the head somewhere -->
    <script type="text/javascript">
     ...some javascript to set the background-image of the div to a random image...
    </script>
    <noscript>
     <style>...css code to set the background-image of the div to some image...</style>
    </noscript>
    
    ..later, in the body..
    <div id="whatever"></div> <!-- holds the background image -->

    See?

  18. ericr23
    Member
    Posted 5 years ago #

    So, any answer to why the index page is cached even though "index.php" is an excluded string?

    Or rather, why wouldn't it be, since with "pretty" permalinks, every single page is index.php, too.

    Perhaps the solution is to have an option like "Clear all cache files when a post or page is edited" but applying just to the index page cache.

    Our WordPress blog runs in its own directory. Posts are written in the dashboard and published immediately. The index page appears to be cached for both wp-cache and wp-supercache. Version 0.8.4, WordPress 2.6.

  19. ericr23
    Member
    Posted 5 years ago #

    Try deleting the "index.php" exclusion string.

    I did that and everything seems to be working as it should. The index is cleared with every edited and new post.

    (One odd thing, though: although I'm logged in, it's being provided by supercache.)

  20. hemasunder
    Member
    Posted 5 years ago #

    problem solved updating to the new version

  21. Rishi
    Member
    Posted 5 years ago #

    Hmmm, I still have a problem with the main page (http://www.rishi-kumar.com/index.php) being cached by the latest version of WP Super Cache. I've temporarily disabled the plugin, but just to give you an idea of my set up.

    Site: http://www.rishi-kumar.com
    Installation: .../home/public_html/
    Super Cache ver: 0.8.4 (latest)

    Rejected URIs:
    index.php
    wp-.*.php

    I tried removing the index.php from the rejected URI list, clearing the cache, clearing my browser cookies/cache, and then revisiting the website. WP-Super Cache still processed the main page (index.php).

    Is anyone else experiencing this?

  22. mjsteinbaugh
    Member
    Posted 5 years ago #

    I'm having the opposite problem, where WP Super Cache won't cache my index.php file. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic