How do I create a cache.manifest add it to my index and css and ensure my HTML5 app gets reloaded?

0 favourites
  • 8 posts
From the Asset Store
A sound pack containing 132 laser gun sound effects, including mono and stereo versions of audio files.
  • Hello,

    I am creating a browser app with Construct that is meant to be added to the home screen to work offline, have an app icon and no distracting browser UI.

    Now I found out that websites that were added to the homescreen don't refresh. So I could never update the app...

    Now I found this stackoverflow post that says to:

    - create a cache.manifest

    - add it to your index and css

    - and to ensure the website gets reloaded when the cache is updated

    Link:

    https://stackoverflow.com/questions/8792255/how-do-you-force-an-ipad-home-screen-bookmarked-web-app-to-refresh

    But how the **** do I implement that into Construct?

    :D

    And more importantly: do you think this will work and solve my issue? + It's very important that the user's local storage still works. But it should, I mean if I don't add the website to the home screen and save local data and then refresh the site everything works as well...

    Any help would be greatly appreciated!

    Have an amazing weekend,

    Chris

  • I'm afraid the information you found is years out of date. That technology is no longer used in favour of Service Workers. Construct automatically uses these for offline support, and you don't have to do anything.

  • Hi Ashley, thank you very much for your response. That does sound great.

    But why don't my home screen browser apps refresh then, since I hope I can create updates in the future :)

    Have an amazing day!

    Chris

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It should work as described in the tutorial Offline games in Construct 3.

  • Oh my damn, this looks perfect. I've never seen this Tutorial! Thank you so much Ashley!

  • Sorry Ashley for replying here. But the tutorial's comment section only allows 1000 characters, and my 994 character question still doesn't post. So:

    I have exactly the issue described in "Troubleshooting". I implemented a little Update Mechanic using on update ready, opening a pop-up and then when the user presses an "update" button the browser object > reloads (as described in Other Useful Features)

    It's for a browser app by the way (html5 export that gets added to home screens) as described in the intro of this tutorial.

    Question: But how the hell do I configure my server's cache??? I'm sorry but I couldn't find anything on google myself. I checked if I can configure it on my web hosting provider's control panel.

    How can I do exactly this exactly:

    "If you are not seeing an update happen even after uploading a whole new set of files including offline.json, check the caching configuration of your web server."..."If it allows the files to be permanently cached, you may never see an update happen. Clearing your browser cache and inspecting the server's HTTP response headers can help identify this."

    I'd be so thankful for any help :)

    Tutorial Link from Ashley above: construct.net/en/tutorials/offline-games-construct-8

  • It depends on the server and on the host. So it's difficult to offer any specific help with. Try contacting your host for support on the server configuration.

  • SOLVED:

    Two thing ->

    ---

    My mistake was that I have two domains, the one being a SSL certified one (so HTTPS) the other one is not. So I accidentally put the browser app in the wrong folder on my server resulting in it becoming an HTTP: link!

    As stated in the wonderful tutorial shared by Ashely above, the whole updating of offline games only works on https:// websites.

    Now it works :)

    ---

    Regarding the server caching settings (posts above) I had a chat with my provider and found out that since its a web hosted-shared server I do not have the possibility to look-up or change my own caching settings :D thanks IONOS.

    They told me it's set to 10 - 15 minutes. Which is about right now that I host the browser app at the correct location. They said I could change it using user.ini files. But I've not gotten into how that might work...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)