• Is it possible to set WP-SUPER CACHE to spit out its cached file with a PHP extension rather than HTML? Reason I ask, is that I have some server side PHP script which I need to execute upon every page refresh. The script basically detects the user-agent string and stores this value in a variable. I then print the value of this variable in the <BODY> class, see below:

    backticks

    // Figure out which browser the user is using

    $user_agent = $_SERVER[‘HTTP_USER_AGENT’];

    if (preg_match(‘/Firefox/’, $user_agent)){
    $browser = “ff”;
    } else if (preg_match(‘/Firefox.3.0/i’, $user_agent)) {
    $browser = “ff ff30”;
    } else if (preg_match(‘/MSIE.9/i’, $user_agent)) {
    $browser = “ie ie9”;
    } else if (preg_match(‘/MSIE.8/i’, $user_agent)) {
    $browser = “ie ie8”;
    } else if (preg_match(‘/MSIE.7/i’, $user_agent)) {
    $browser = “ie ie7”;
    } else if (preg_match(‘/MSIE.6/i’, $user_agent)) {
    $browser = “ie ie6”;
    } else if (preg_match(‘/Chrome/i’, $user_agent)) {
    $browser = “chrome”;
    } else if (preg_match(‘/Safari/i’, $user_agent)) {
    $browser = “safari”;
    } else {
    $browser = “in_unknown”;
    }

    <body class=”<?php echo $browser; ?>”>
    backticks

    https://www.ads-software.com/extend/plugins/wp-super-cache/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP Super Cache] Set cached file to PHP rather than HTML?’ is closed to new replies.