facebook

Please help – cache webapp: CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #339382 Reply

    TorstenHinze
    Member

    Sorry for my bad english, I hope you can understand.

    I have a html widget with an iframe to an external page that will change daily.
    In cache.manifest I have registered under this network.
    When I start the app, the widget will also be displayed updated.

    But a Android-App will never closed accurate.

    How can I make it, that the html widget also updated without close the app?
    Would be a button or a update when changing the screens beautiful?

    I do not, can someone help me?

    #339392

    TorstenHinze
    Member

    Can nobody help me?
    Please.
    How can I reload a webpage in a html-widget from server in a android native app?

    #339470

    Hi tiaetsch,

    Here is a thought, let’s assume that the iframe site is cached via appcache for offline support.
    So if you want the iframe to site to reload when page updates automatically while app is running then do this:

    1) On server update the page content and then modify the cahce.manifest file (must change its byte size). On restart of the app will detect the modified cache.manifest and load the changed resources.

    2) For a running app to detect and load a changed page then force the iframe to periodically reload the remote page. Use
    <META HTTP-EQUIV=”refresh” CONTENT=”15″>

    This will then cause the appcache to kick in and load the remote content and cache it.
    the 15 is seconds. Set it to whatever frequency the page needs to update.

    #339535

    TorstenHinze
    Member

    Hi octavio,
    many thanks for answer!
    A refresh of iframe is a good suggestion, but where must I place the metatag, in the html-widget?

    Is there also a posiibility to refresh the html-widget (iframe) with a button in mobione?

    #339543

    support-michael
    Keymaster

    Attached is a simple mobione design that embeds an <iframe> in the screen via an HTML widget. See screenshot below.
    See attachment ss1.png
    The iframe loads an html page that has this metatag to force a reload every 30 seconds.

    
      <META HTTP-EQUIV="refresh" CONTENT="30">
    

    The reload button uses the following hack in the jquery snippet to reassign the iframe.src its current value.

    
      //hack using jquery code to reload the iframe
      $('iframe').attr('src', $('iframe').attr('src'))
    

    See attachment iframe-reload-test.mobi

    Attachments:
    You must be logged in to view attached files.
    #339558

    TorstenHinze
    Member

    Many thanks, wayne.
    Unfortunately, the iframe will always be loaded only from the cache, although I have the page listed in the cache.manifest under “network”.

    How can I prevent loading from the cache there?
    How can I ensure that the page is always loaded from the server?

    I have more than 1 iframes in my app, how can I refresh a concrete iframe?
    When I click on the button, a iframe from another screen is loded.

    I want to pass the app as NATIVE.

    I’m desperate 🙁

    Attachments:
    You must be logged in to view attached files.
    #339570

    support-michael
    Keymaster

    >Unfortunately, the iframe will always be loaded only from the cache, although I have the page listed in the cache.manifest under “network”.

    To confirm that I understand this correctly let me setup a scenario.
    1. MyApp.html includes <iframe src=”remoteData.html”>
    2. remoteData.html uses appcache
    3. and you want remoteData.html to always load from the web, not the cache

    If this is correct, here are my thoughts:
    1) I’m not 100 percent sure that appcaching will work for your iframe provided content. I googled and found that some browsers had errors as recent as a year ago. So I can’t say what your success rate will be across iOS and android versions.
    2) The main html page that specifies the <html manifest=”cache.manifest”> will always be cached even if it is not listed in the manifest file.

    >I have more than 1 iframes in my app, how can I refresh a concrete iframe? When I click on the button, a iframe from another screen is loded.

    Here is an example:

    
      //jquery selector to find the iframe node of the html widget with id property "html1"
      $('[id$=html1] iframe')
    
      //hack using jquery code to reload the iframe, set src to itself
      var myiframe =  $('[id$=html1] iframe')
      $(myiframe).attr('src', $(myiframe).attr('src'))
    
    #339587

    TorstenHinze
    Member

    Many thanks, the reload of the iframe works, but is out the cache.

    I read in intenet of preventing iframe caching in browser, but I do not know how can I realise this in mobione.
    Can you help me with this?

    <iframe id="frame5a" src="http://www.tiaetsch.de/portal/vertretung/klassen/5a.htm?id=[timestamp]"></iframe>
    
    function setTimestamp(){
        var myIframe = document.getElementById('frame5a');
        var timestamp = new Date().getTime();
        myIframe.setAttribute('src', myIframe.getAttribute('src').replace(/\[timestamp\]/, timestamp) );
    }
    #339588

    TorstenHinze
    Member

    Yippee, I found another solution for no caching iframe with .htaccess, that works.
    Thread can be closed.

    Many greetings
    th

    #339598

    support-michael
    Keymaster

    @tiaetsch
    Thanks for the update.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Please help – cache webapp: CLOSED

You must be logged in to post in the forum log in