Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19758

    i’m trying to solve the still unsolved problem that when using any caching plugin, the following line from the header gets cached too :

    <html lang="en-US" prefix="og: http://ogp.me/ns#" class="safari safari6 html_boxed responsive ">

    , serving safari pages to IE and any other combination of browsers, based on the first user to visit the page after caches are cleared (or rebuilt).

    i’ve tried putting the code that detects the browser in a separte file, called browser.php. this is called from the header with :

    <?PHP
    echo file_get_contents('browser.php');

    code in browser.php :

    <?php
    global $avia_config;
    if (function_exists('avia_get_browser')) {
    echo avia_get_browser('class', true);
    }
    else {
    echo "NO-WORKY";
    }

    #104905

    Unfortunately the php based browser detection won’t work correctly if you cache the page content. Some cache plugins offer an “exclude code” feature (i.e. http://wordpress.org/support/topic/plugin-w3-total-cache-how-can-i-exclude-some-code-form-bein-cached ). The only solution would be to implement a js based browser detection but we’ve no plans to implement it in the near future.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘solve caching problem with external php file’ is closed to new replies.