WP Super Cache
Fixed: delete individual pages from cache (3 posts)

  1. Gonçalo Peres
    Posted 3 years ago #

    Greetings Donncha and thank you for WP Super Cache.
    I think "Small is Beautiful", so I choose it over other more complex caching plugins.

    One glitch, however, has been bugging me ever since. The button on the admin bar to delete individual pages never works.

    I use permalink structures without trailing slash (Ex: /%year%/%monthnum%/%postname%).
    URLs like "http://example.com/about" look more appealing than "http://example.com/about/"

    So i dig the code and found the problem. On line 385 in "wp-cache.php", you assume the permalink structure always ends with a slash:

    $path = get_supercache_dir() . preg_replace( '/:.*$/', '', $_GET[ 'path' ] );

    Because i dont use trailing slashes the plugin was looking for something like "/var/www/multisite-network.com/wp-content/cache/supercache/example.com/2013/04/somepageindex.html" to delete when "prune_super_cache( $path . $cache_file, true );" was called on line 388.

    So the simple and obvious solution was to use the trailingslashit function on line 385, which is precisely for what this WordPress function was created:

    $path = trailingslashit( get_supercache_dir() . preg_replace( '/:.*$/', '', $_GET[ 'path' ] ) );

    I hope you fix this in an upcoming version.

    Thank you and best regards.
    Gonçalo Peres


  2. Gonçalo Peres
    Posted 2 years ago #

    Greetings Donncha.
    I noticed this hasn't yet been fixed in the latest releases.
    Just a reminder.
    Thank you again, for this great plugin.

  3. Donncha O Caoimh
    Plugin Author

    Posted 2 years ago #

    Thanks Gonçalo, I missed that code but I've just checked it into trunk so the development version will update in the next 20 minutes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic