HTML5 force clear cache - how to ? - SOLVED

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • [EDIT] The title is a bit misleading. It should be something like:
    "how to get the users always loading the newest version of your html5 application in their browser".
    I apologize for that. [/EDIT]

    Dear clickers !

    By deploying new versions of an HTML5 application, the browser refuses to load the new deployed version and keeps loading the old one.

    I'm aware that from within the browser you can press ctrl+shift+F5, thus deleting the cache and loading the fresh new version of the application, but I wonder if there is another way to do this programmatically from within the application itself..

    Any help is appreciated.

    Take care,
    Sergio.

    Edited 3 times, last by semar (March 21, 2024 at 6:36 PM).

  • This is Please login to see this link.. Firefox supported a non-standard thing for a while.

    To get it to work, you don't need to clear the cache. Just do Build + Run again, and a regular refresh will work, as far as I've tested. If not, keeping DevTools open on Network tab will disable cache anyway when refreshing:

    Please login to see this attachment.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Thanks Phi for your answer, but there's a misunderstanding here.

    I meant a deploy on a remote website. I deploy the html5 application via ftp on my remote website (example: Please login to see this link.).

    The browser keeps loading the old version of the ( deployed ) application. Pressing shift+ctrl+F5 from within the browser indeed forces the browser to discard the cache and to load the new deployed version, but I wonder if there were another way to make the browser load the newest version without having the user to press that keys combination..

    Perhaps is there a setting of the html5 application from within Fusion ?

    That was the question. I apologize if it caused confusion.

  • You probably want to pass Please login to see this link., like no-cache, must-revalidate, etc.
    In PHP, you can set them by running, e.g.
    <?php header("Cache-Control: must-revalidate"); ?>
    before the page content.

    must-revalidate could be incorrect in this case. Point is you can control how long pages are considered valid by the browser in the server's response headers.

    If you're using CloudFlare, it has its own cache as well.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I guess the only thing it would work, is a redirect to a new page. The user "sees" always the same link, but the "link" redirects the browser to a page containing the new version. It should work, I'll test it. [EDIT: redirect does not work either [/EDIT]

    Anyway, better would be a setting inside the html application (from within Fusion I mean.)

    I could "simulate" the keyboard pressing of the key +shift+ctrl+reload in the html5 app, but it would do it everytime and the application would always reload itself..
    hmm.. I could get the newest version number from a php script and if this number does not correspond to the version in the application (because che version in the cache has been loaded) then the app could "press" that key combination..
    hmm...it's a bit convoluted but it may work..

    Sadly the extension "ControlX" works only in windows application and not html5..

    I'm a bit screwed up !!

  • Thanks, however it does not work either.
    Here is what I have inside the index.html:

    If it's a PHP file, it'll be index.php.
    Much the same content, but the PHP parser will look for PHP code within <?php ... ?> tags, and parse it, ignoring the rest of the text.
    For a .html file, the PHP parser won't activate.

    That is, if you have a server with a PHP parser on it. It's pretty common but it's not everywhere.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • If it's a PHP file, it'll be index.php.
    Much the same content, but the PHP parser will look for PHP code within <?php ... ?> tags, and parse it, ignoring the rest of the text.
    For a .html file, the PHP parser won't activate.

    That is, if you have a server with a PHP parser on it. It's pretty common but it's not everywhere.

    Thanks Phi, however it does not work either.

    What I have:
    index.php
    Please login to see this attachment.

    test.html ist the page that contains the Runtime.Js - that is, the html page generated from within Fusion 2.5+

  • Ok, I think I've nailed it. As usual, the "problem" was between the chair and the laptop. :rolleyes:
    Here is the solution:

    1. delete all the files from the remote directory
    2. copy the new version files from the deployment pc/laptop/whatever
    3. paste the new version files on the remote directory
    4. give the user the complete application URL - that is, the URL with the suffix www.

    This way works - at least for me. I hope it could help other clickers ;)

    Take care,
    Sergio.

    P.S.
    Thank you Phi for your kind support !

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!