Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] WordPress in directory and cache on post edit not removed

  • Hello there,
    I have WordPress installed in directory: example.org/news

    WP Super Cache is created under:
    /wp-content/cache/supercache/example.org/news/link/index.html.php
    -> Works OK

    WP Super Cache Settings tab:
    Button to delete all cache files
    -> Works OK

    Post edit page:
    Edit/change post and click save
    -> Error, cache files ale not marked as .needs-rebuild and users get old page version.

    I looked at get_current_url_supercache_dir() function and it returns bad directory path (when deleting cache only, good path for creating):
    /wp-content/cache/supercache/example.org/link/index.html.php
    instead of:
    /wp-content/cache/supercache/example.org/news/link/index.html.php

    Is it WP-Super-Cache bug ?
    It generates path with /news/ when creating cache
    And generates path without /news/ when tries to remove cache on post change

    For hot fix I changed this:
    global $cached_direct_pages, $cache_path, $wp_cache_request_uri;
    to:
    global $cached_direct_pages, $cache_path, $wp_cache_request_uri, $wp_cache_home_path;

    And this:
    $uri = str_replace( '\\', '', $uri );
    to:

    $uri = str_replace( '\\', '', $uri );
    if(strpos($uri,$wp_cache_home_path) !== 0) {
        $uri = rtrim($wp_cache_home_path, '/') . $uri;
    }

    And now it works for post edit…

    Thanks for some response.

    http://wordpress.org/extend/plugins/wp-super-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for that but it can’t go in there as it is. Sites that use WordPress in a directory but are served from the root will have the extra prefix (news in this case) added to the path. This is tricky 🙁

    Fixed it, by putting the rtrim commands in a different place where they won’t affect users of the sites described in my previous post.

    Dev version should update in the next 20 minutes if you’d like to give it a go?

    http://ocaoimh.ie/y/2o

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Super Cache] WordPress in directory and cache on post edit not removed’ is closed to new replies.