0

HTML No Refreshing

I have a html website where students post uplifiting messages and then they show up on the website after being apporved.   Its showing up fine on the website on our computer when new messages are approved but is not updating on the players.  Any solutions

 

3 comments

  • 0
    Avatar
    Mark Richards

    Possibly a caching issue?

    You could try reloading the page periodically to pick up changes. for example:

    <!DOCTYPE html>
    <html>
    <head></head>
    <body>

    <p>I reload every every 10 seconds...

    <script>
    function timedRefresh(timeoutPeriod) {
        setTimeout(nextPage,timeoutPeriod);
    }

    function nextPage() {
        window.location.reload();
    }

    function updatePage() {
      // Timer to reload page
      timedRefresh(10000);
    }

    if (window.attachEvent) {window.attachEvent('onload', updatePage);}
    else if (window.addEventListener) {window.addEventListener('load', updatePage, false);}
    else {document.addEventListener('load', updatePage, false);}
    </script>

    </body>
    </html>

  • 0
    Avatar
    Vicente Krajcik

    It sounds like the issue is likely caching on the players. Mark’s suggestion of using a timed refresh is a good approach. Another thing you could try is making sure your server sends headers to prevent caching, like Cache-Control: no-cache or Pragma: no-cache, so the players always get the latest approved messages without needing a manual refresh.

  • 0
    Avatar
    jerry poplar

    This is most likely a cache issue on the players. Your computer refreshes the page and pulls the newest messages, but the players are showing an old cached version.

    Try adding no-cache meta tags to your page:
    <meta http-equiv="Cache-Control" content="no-store" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

Please sign in to leave a comment.