Support » Plugin: WP Super Cache » Customize the "make users anonymous" feature?

  • Resolved jondaley


    I have a site that is mostly anonymous (I use javascript to do the customized portions), and so I’d like to use the “make users anonymous to serve supercache files” feature, but I have one section that is entirely customized for each user, and so what I’d like is if the list of files that is forced to be not cached would override the remove cookie code.

    We wrote a while ago about the remove cookie function, and you were going to make it easier to customize that – did that ever happen?

Viewing 1 replies (of 1 total)
  • I went back and found my old post:

    describing the new feature that was added. Though as I noted, it was broken at the time.

    I worked on this today, and here is what I did:

    mkdir wp-content/themes/paleo/supercache_plugins
    edit wp-content/wp-cache-config.php:
    look for $wp_cache_plugins_dir = ...;
    and replace with
    $wp_cache_plugins_dir = ABSPATH . 'wp-content/themes/paleo/supercache_plugins';

    Made a new file in the supercache_plugins directory, named whatever you want:

    function paleo_force_nosupercache() {
      global $cache_rejected_uri; 
        return false;
        return true;
    add_cacheaction( 'wp_supercache_remove_cookies', 'paleo_force_nosupercache' );

    I didn’t need to be able to enable this code via the supercache plugins page, but you can copy the _admin code from a provided plugin in wp-content/plugins/wp-super-cache/plugins if you need that behavior. I also didn’t need any provided plugins, you would need to copy or symlink them if you need them.

    I wonder if this behavior should be in the core code, because if a user has put in a URL on the don’t cache/rejected_uri list, they probably don’t want it ever cached, even if the user is anonymous?

    I guess it isn’t defined which setting takes priority.

Viewing 1 replies (of 1 total)
  • The topic ‘Customize the "make users anonymous" feature?’ is closed to new replies.