Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

force webapp lo load page every time it is opened

24 views
Skip to first unread message

lea...@leandro.org

unread,
May 2, 2013, 11:09:59 AM5/2/13
to
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?

regards,
Leandro

Kumar McMillan

unread,
May 2, 2013, 11:35:34 AM5/2/13
to lea...@leandro.org, dev-w...@lists.mozilla.org
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
> dev-w...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-webapps

Jonas Sicking

unread,
May 14, 2013, 1:46:22 AM5/14/13
to lea...@leandro.org, dev-w...@lists.mozilla.org
Have you tried sending those headers as real headers, rather than
using meta tags?

Webapps follow the normal caching semantics of the web, so this should
be no different from creating a website. However I don't remember off
the top of my head which headers can be expressed using <meta> tags
and which ones don't.

/ Jonas

lea...@leandro.org

unread,
May 15, 2013, 11:09:18 AM5/15/13
to
hi! thans to all of you, folks

i opted for Visibility API solution as Kumar suggested and everything is going fine
0 new messages