Support » Plugins » no super cached pages with WP Super Cache

  • hi donncha,

    I’m in the process of restructuring our blog, which content wise is quite dynamic and I have managed to migrate pretty much everything to AJAX requests that need to be kept dynamic. So far so good, except a major issue I’d need to get resolved concerning Super Cache: no super-cached pages are being delivered.

    (1) I installed the Super Cache plugin per the instructions and it seems to run fine, except for actually delivering <!– super cached –> pages. The admin page does show both wp-cached and super-cached pages, super cached pages triggered by unknown visitors (file system/folder structure is intact).
    3 observations:
    (1.1) on occasion, completely unkonwn users get a dynamic page (even though it’s already cached!)
    (1.2) on reload, unkonwn users then get the <!– Cached page served by WP-Cache –>
    (1.3) but they never get a <!– super cached –> page?!

    *) I use PHPSESSION (COOKIE based) on the blog
    *) I use add’l COOKIES on the site, but non would match the .htaccess rules
    *) .htaccess rules are the std ones

    Any ideas?

    PS: the site has access restrictions in place, but I’m happy to send you an email on how to access.

Viewing 15 replies - 1 through 15 (of 24 total)
  • I think I got it down to these two lines .htaccess that won’t work:

    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]

    If I comment out the RewriteCond line (knowing that the index.html file in fact exists on the server), the RewriteRule now kicks in, but produces a 500 error.
    It seems that somehow the path:
    is broken….

    Any ideas? Anyone?

    It’s not working for me, either. That directory is empty.

    I’ve also noticed an inconsistency between reported, super cached pages and actual present super cached pages:

    * 0 cached pages
    * 0 expired pages.

    is shown even though the file system shows super cached index.html files with current timestamps.

    Please include some details about your server environment. Are you using Apache? mod_php or fastcgi?
    Any other plugins?

    Olivers – Can you remove the last slash from those two lines so the end looks like this?

    Does that help?

    $1index.html didn’t do the trick. Let’s take is step by step and forget about the last condition rule (I commented it out).

    This is what is left:

    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L,R]

    The [L,R] is for testing purposes.

    Here is another interesting observation:

    If I uncomment the older 3 WP lines:

    # RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteCond %{REQUEST_FILENAME} !-d
    # RewriteRule . /index.php [L]

    (1) all of a sudden url/about works and delivers the super-cached page (showing the exploded rewritten URL).
    (2) url/about/ however results in an infinite loop: producing url/wp-content/plugins/cache/super…/wpcontent/plugins… etc

    Which leads to two questions:
    Q1) Why do need to remove the WP lines which of course breaks WP normal pages? Shouldn’t the processing stop after the super-cache rewrite [L]?
    Q2) To make sure that URLs with and without a trailing slash work, I guess another rule is required to compensate for a missing trailing slash (‘equalizing’ the URL).

    Are the supercache rules before or after the regular WordPress ones? They should be before.


    I was getting this same problem. Seeing the rewrite logs I had noticed that the rules didn’t match because the files path was incorrect.

    Reviewing the instalation procedure, I saw that my virtual host configuration didn’t match with wpmu instalation instructions.

    I had installed the wpmu in ~home_folder/public_html/wpmu, but I didn’t create a virtual host to point to this folder.

    When I fixed the virtual host configuration to point correctly to my wpmu folder, I get it working fine.

    Perhaps the super-cache must be patched to work with non-virtual hosts, but in this case I think the error was mine.

    I wish it can help you.


    Thank you rhapsodyv. I’m sure it is a related issue but I can’t quite put my finger on it.
    Our provider did let us know that we’d to ditch %{DOCUMENT_ROOT} and instead use a full path, as well as that we’d need to use %1 vs. $1 – still, same issues…I’ll stay on it, it’s against my nature to give up on software.

    OK I f-i-n-a-l-l-y got it working. With some mod_rewrite trickery.

    Here is what helped me, since my host has issues resolving paths correctly I had to hard code these. Also, I needed to make sure that for URL/permalink (without the trailing slash) it would also work and avoid any recursive rewriting.

    Long story short, for what it’s worth:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^.*/.+\..+$
    RewriteCond %{REQUEST_URI} ^.*[^/]+$
    RewriteRule ^(.*)$ $1/
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
    RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
    RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$
    RewriteCond /my/full/path/wp-content/cache/supercache/$0/index.html -f
    RewriteRule ^(.*)/$ /wp-content/cache/supercache/$1/index.html [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    That doesn’t work for me unfortunately.

    It worked for me.

    “/my/full/path/” should be something like “/home/username/public_html/”?

    correct. I don’t expect a lot of hosting providers to have the same ‘funny’ requirements, %{DOCUMENT_ROOT} ought to have worked, but if you provide your full path starting from root / then you don’t take chances.

    PS: this can fix .htaccess / rewriting issues, of course it doesn’t address any ‘my super-cache dir is not being populated’ type problems.

    …of course it doesn’t address any ‘my super-cache dir is not being populated’ type problems.

    No wonder… 🙁

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘no super cached pages with WP Super Cache’ is closed to new replies.