On May 2, 2013, at 10:09 AM, [email protected] wrote: > hi! > im developing a hosted webapp, my problem is once installed the app doesn't > reload the page every time it is launched, i show real-time data so this is > useless... i saw other apps like twitter or facebook, they are reloaded each > time the app is opened... how do they do that? > > i tried with : > > <meta http-equiv="Cache-Control" content="no-cache, no-store, > must-revalidate" /> > <meta http-equiv="Pragma" content="no-cache" /> > <meta http-equiv="Expires" content="0" /> > > but no luck :-/ > any suggestion?
Hi Leandro. This is a common problem for modern websites/apps that want to show realtime data. The typical pattern is to make an Ajax request and update the HTML in your page when you get a response. The concept is explained here -- https://en.wikipedia.org/wiki/Ajax_%28programming%29 -- and some examples are here http://www.w3schools.com/ajax/ajax_example.asp Twitter and Facebook use techniques like this. You can also use the visibility API to know when your app becomes visible so that you can do a new Ajax request https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API > > regards, > Leandro > _______________________________________________ > dev-webapps mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-webapps _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
