• Resolved redsector72

    (@redsector72)


    I am having troubles with cache preload. It works but sometimes it deletes all the files after running. Still investigating probable causes with debug activated.

    I have found a probable bug for you to check.
    The code that i conside bugged is:
    $url_info = parse_url( $url );
    $dir = get_supercache_dir() . $url_info[ ‘path’ ];

    I get a double slash with that.
    My wp website is inside a subfolder, like https://www.tld.com/us/News/
    So get supercache dir gets /wp-content/cache/supercache/www.tld.com/us/news/
    and url_info gets /us/News/whatever.
    this will bring $dir to be /wp-content/cache/supercache/www.tld.com/us/news//us/News/whatever with a double slash that causes “wpsc_get_realpath: directory does not exist”

    I’m still not sure how to fix this myself and if this causes problems else where.

    Hope this helps and to get feedback on how to solve it

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mark (a11n)

    (@thingalon)

    Hi @redsector72,

    Thanks for your report!

    I’ve just tested wpsc_get_realpath with a directory with two slashes in it, and found that it works as expected. There must be more going on here.

    First, is your site hosted on a Windows server? I ask because Windows directory handling can be a bit different to Linux, which may explain why I’m seeing different behavior on my test site.

    Second, have you double-checked that the named directory exists on your server? I know that may seem like an obvious question, but I sometimes find with particularly long directory names like these it is easy to accidentally check the wrong location.

    Finally, have you had any further luck investigating why your preload filed are being wiped out? I hope your debug logs end up shedding some light on what’s going on.

    Thread Starter redsector72

    (@redsector72)

    Hi @thingalon,
    I’m on Ubuntu/Plesk
    I’m not sure if I got the exact bug location.
    The behavior is still there, My programmings skills are not to the level.
    The directory exist and is like /var/www/vhosts/TLD.com/us/News/

    At present time I have surrendered the preload function.

    I have set up the plugin in preload mode so it does not delete cache file and I have created a bash script to generate them correctly calling them from curl.

    Now it works as expected, plus I have a lot more cached files (almost 600 vs 300).

    Plugin Contributor Mike Stott

    (@mikemayhem3030)

    Thanks @redsector72

    Now it works as expected, plus I have a lot more cached files (almost 600 vs 300).

    We’ll keep an eye out for any further reports of this and if so move it up the list to be investigated further / fixed.

    Until then, I’ll mark this as resolved but if it becomes a problem for you just pop a reply back and let us know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Probable bug’ is closed to new replies.