Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #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:" 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 :

    echo file_get_contents('browser.php');

    code in browser.php :

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


    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. (Purchase code hidden if logged out)(Purchase code hidden if logged out) -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.