× Warning! This forum is in archival status. New contributions may not work.
Kill the caching for your station player!
  • This works best on 'pop-up' players because, then, only the player is affected.

    Most of the player code available sits in a normal web page and therefore caches content which can result in unexpected problems.

    The player can start playing old content, when restarted, followed by a content jump when the cached buffer runs out. This can 'look' like the wrong track is playing, wrong time check anouncements and similar.

    The solution is, in essence, quite simple. We force the page not to cache, under any circumstances. Then the content will always be current - which is what we need.

    For how it works see here: http://www.htmlgoodies.com/beyond/reference/article.php/3472881

    We need to place a fews lines of code in 2 <head> sections on the page and to change the <body> tag.

    1. Change the page's <body> tag to:
             <body onLoad="if ('Navigator' == navigator.appName) document.forms[0].reset();">

    2. In between the <head> </head> tags insert:
            <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
            <META HTTP-EQUIV="Expires" CONTENT="-1">

    3. Between the </body> and </html> tags at the bottom of the page insert this (yes, I know this is not usual!):
            <head>
                    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
                    <META HTTP-EQUIV="Expires" CONTENT="-1">
            </head>
    4. Thats it.
    Post edited by John Chewter at 2013-12-09 08:45:13
    No longer using Airtime or Libretime.
  • 4 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Thanks for the tip, John - I had experienced that caching issue myself :-)

    Cheers!

    Daniel
  • I posted it as an improvement bug so it gets applied to the 'Listen Now' window in the backend. You can find quite a few unresolved posts in here that this will fix.
    Post edited by John Chewter at 2013-12-09 07:40:28
    No longer using Airtime or Libretime.
  • <audio preload="none" autobuffer="false">
    <source src="http://127.0.0.1/mount" type="audio/mpeg">
    </audio>

    :)
  • That will not help with flash and other non html5 players.
    No longer using Airtime or Libretime.