• Resolved Optimizing Matters

    (@optimizingmatters)


    Not a support question, but might be useful for anyone encountering the same issue;

    I was struggling with occasional loss of reported traffic due to my pages being cached by WP Super Cache (which is not active for logged in users) but not having SlimStatParams & the slimstat JS-file in it. I tried changing different settings in Slimstat, but the problem still occurred. I was not able to pinpoint the exact root cause, so I ended up using this code snippet to prevent pages being cached by WP Super Cache if they don’t have SlimStatParams in the HTML source:

    
    add_filter('wp_cache_ob_callback_filter','slimstat_checker');
    function slimstat_checker($bufferIn) {
      if ( strpos($bufferIn, "SlimStatParams") === false ) {
    	define("DONOTCACHEPAGE","no slimstat no cache");
    	error_log("no slimstat = no cache");
      }
      return $bufferIn;
    }

    hope this is useful for someone someday ??

    frank

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Pages without SlimStatParams & WP Super Cache’ is closed to new replies.