WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] No "SuperCache" Directory (11 posts)

  1. michaelpark
    Member
    Posted 6 years ago #

    Hello;

    Like many others here, I've tried this without success.

    I installed it just fine, but it wasn't caching at all. I think the problem was that the "supercache" didn't get created, and the "cache" directory was locked afterwards.

    Any idea?

  2. Donncha O Caoimh
    Member
    Posted 6 years ago #

    What's the value of $super_cache_enabled in wp-content/wp-cache-config.php ?

  3. michaelpark
    Member
    Posted 6 years ago #

    It's set to true.

    $cache_compression = 1; //Added by WP-Cache Manager
    $cache_enabled = true; //Added by WP-Cache Manager
    $super_cache_enabled = true; //Added by WP-Cache Manager
    $cache_max_time = 3600; //in seconds
    //$use_flock = true; // Set it true or false if you know what to use
    $super_cache_max_time = 21600; // in seconds
    $cache_path = ABSPATH . 'wp-content/cache/';

    It's still not caching even though the "cache" directory is set to 777.

    And here's my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
    RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
    RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
    RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
    RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    </IfModule>
    # END WordPress

    But the "supercache" directory is empty.

  4. Donncha O Caoimh
    Member
    Posted 6 years ago #

    What are the last 5 lines of your wp-config.php ?

    Is WP_CACHE set?

  5. michaelpark
    Member
    Posted 6 years ago #

    Yes, it is.

    define('WP_CACHE', true);
    define ('WPLANG', '');
    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
  6. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Stranger and stranger. The only suggestion I have is look through the code yourself. Look at the "wp_cache_ob_callback" function in wp-cache-phase2.php and figure out where it goes wrong by debugging with error_log()

  7. michaelpark
    Member
    Posted 6 years ago #

    Where does "$supercachedir" get set first? I don't see it in the config.

    And where do I put "error_log" function?

    Thanks.

  8. beernews
    Member
    Posted 6 years ago #

    What eventually worked Michael? I'm running into the same issue. I looked at everything in the readme.

  9. Matisme33
    Member
    Posted 5 years ago #

    Hey all.
    I had the same exact problem : no supercache directory created (and therefore, no caching at all), whereas everything else seamt to be ok.

    After many hours struggling, i finally found out, thanks to a french blogger who gives a hint on his blog.

    The trick is to :
    - create manually wp-content/cache/ and wp-content/cache/supercache and give them chmod 777
    - install the plugin, update the .htaccess
    - AND THEN, MAGIC TRICK : change the defaut value of
    $sem_id in wordpress/wp-content/wp-cache-config.php (around line 48)
    Put any 4 digits you want (actually i think any value might be ok, didn't tested).

    I think creating manually /cache/ and /cache/supercache might even not to be necessary, i think only modifying $sem_id does the job.

    I've spent many hours browsing the internet for the answer to this specific yet common issue (many people seem to have the same issue) : the only (effective) answer i found is this one.

    Credit goes to Antoine for finding a solution and sharing.

    Peace all.

  10. jdandrea
    Member
    Posted 5 years ago #

    Matisme33 - greetings!

    I tried your steps (THANK you for sharing!) but, alas, no dice. :(

    I have a supercache directory, it's 777 perms, the .htaccess files are all in place, everything's looking good, I changed $sem_id, the whole deal, but nothing is landing in the cache.

    Hmm ...

  11. jdandrea
    Member
    Posted 5 years ago #

    Progress! WP_CACHE was in the wrong place in wp-config.php (meaning it was the last thing in the file). I moved it up above the final include and now we've got caching!

    Now for a reality check to make sure all's well.

    I see most of the files end up in the cache and cache/meta directories but not under supercache. For instance:

    meta/wp-cache-0b70cbdeb2cdcf07215ef5b4dc720562.meta
    wp-cache-63d9a2d4a3b7de539ca16fea74e80d3e.html

    For supercache I'll always see this (my site's blog is under the blog directory):

    supercache/www.mysite.com/blog/post-slug

    That is, a directory but no file. On occasion I'll see a few index.html files though:

    supercache/www.mysite.com/blog/post-slug/index.html
    supercache/www.mysite.com/blog/2008/04/index.html

    Is this normal - the occasional files in supercache?

    If so, we're all set!

Topic Closed

This topic has been closed to new replies.

About this Topic