Don't Miss Out

Follow us now so you don't miss new releases!

Construct 2 Release r235

There is a more up to date Stable Release! Download the latest Stable release instead here.

59.7 mb, Windows 8/Windows 7/Vista/XP

Wednesday, September 14, 2016

New this build: new offline support using Service Workers!

Changes in offline support

For a long time Construct 2 games have been able to run offline using a browser technology called AppCache. This is more or less a text file with a list of URLs to save (appearing as offline.appcache in your exports). However AppCache is generally regarded as a mistake, and browser makers are starting to begin a long-term process of dropping support for it. A new and more powerful technology called Service Worker is being developed to replace AppCache for offline support, as well as being capable of other background services like background sync, push notifications, and geofencing (much of which is still in development).

Service Workers are currently only supported in Chrome and Firefox, although it's in development for Edge and is under consideration for Safari. It is likely that in the long-term all browsers will support Service Workers and ultimately AppCache will be removed, so the transition is inevitable.

Offline support with Service Worker

The new offline support is designed to work similarly to AppCache, i.e.:

  • The first visit causes the whole game to be saved locally.
  • Subsequent visits load entirely from the locally saved copy. Not only does this mean it can load offline, it also loads faster and saves bandwidth since no further server resources are requested.
  • When you upload a new version, on the next visit it loads the old version still, but updates to the new version in the background.
  • Once the background update has finished, pressing the browser "reload" button will then load the new version. (This means you usually have to reload twice, with enough time in between for the background download to finish.)

Note this only applies to web-based exports. Platforms like Cordova, NW.js and Windows Store apps already load from local resources, so none of this applies to them.

The Service Worker based implementation has some differences to the old AppCache support:

  • Service Workers only work on HTTPS. We have warned before that powerful new web platform features will only allowed on HTTPS. If you haven't yet moved to secure hosting, note it is now required for offline support.
  • AppCache could slow down the first load of the game, since it would be caching the entire game (such as music files that aren't needed immediately) while the progress bar is showing. The new Service Worker system waits until the game finishes loading before starting to save a local copy, so it shouldn't slow down the first load.
  • In Chrome, it can't update when you press "reload" - you currently have to close and reopen the browser window/tab (hopefully this can be fixed)
  • Because the new system works differently to the old one, we've deprecated the Browser plugin's 'Is downloading update" and "On update ready" conditions. These only work with AppCache.
  • Like some browsers did with AppCache, the Service Worker will log messages to the browser console indicating if it is up-to-date, downloading an update, ready to update, etc. You should look for these messages if you want to test a new version you've uploaded so you know when it's ready.

Since not all browsers support Service Workers yet, we are still keeping the old AppCache support for the time being! This means:

  • Exported games use both AppCache and Service Worker for offline support
  • Browsers that support Service Worker will use that and ignore AppCache (except note this bug in Chrome that means it will unintentionally save an AppCache but not use it)
  • Browsers that don't support Service Worker will keep using AppCache

Overall, this is a bit complicated, but the transition needs to happen. Due to the various differences and complexities of making the transition we are keen for this to get thorough testing. So if you publish to the web at all, please try exporting your games, playing them once online, going offline (e.g. pull out network cable, disable wifi, etc), then trying to load the game from the same URL again. All being well it should still load and play the same as it did before, even with no connection. Remember if users do "add to homescreen", save shortcuts, or use other features to make a web page more app-like, offline support is particularly important for those cases since users will expect it to act like an app that works offline too.



New offline support based on Service Worker


Browser plugin: deprecated 'Is downloading update' and 'On update ready' conditions

Bug Fix

Mouse plugin: mouse buttons could get stuck in a "pressed" state if opening a window in a click

Bug Fix

IAP plugin: Javascript error using preview-over-wifi

Do you like this release?

We'd love it if you could show your appreciation of it by retweeting and sharing it on Facebook and Twitter!

Posted by Scirra Ltd on 9/14/2016


Jijiji 3,656 rep

Very interesting update! thank you

Wednesday, September 14, 2016 at 3:28:36 PM
Paradox 42.1k rep

Thank you!

Wednesday, September 14, 2016 at 3:37:59 PM
Laughing14 3,302 rep


Wednesday, September 14, 2016 at 3:38:15 PM
AbelaNET 14.9k rep

Always looking forward for these updates. Keep it up.

Wednesday, September 14, 2016 at 3:43:17 PM
Marxally 2,479 rep

The new offline feature looks promising, great update!

Wednesday, September 14, 2016 at 3:43:22 PM
orangemicro 3,429 rep

I use "add to homescreen" for each one of my games for the full-screen feature. Thanks for the update!

Wednesday, September 14, 2016 at 3:45:51 PM
prashant3999 1,503 rep

Thanks Scirra great work team keep it up

Wednesday, September 14, 2016 at 3:55:28 PM
sanjibnanda 9,951 rep

simply saying ! ---thanks

Wednesday, September 14, 2016 at 4:04:16 PM
jogosgratispro 23.4k rep

You guys are amazing. Always on top of everything. Thanks!

Wednesday, September 14, 2016 at 4:06:33 PM
Rexu 4,018 rep

Deprecated? What? I've been using them all the time!

Wednesday, September 14, 2016 at 4:06:35 PM
chadorireborn 65.5k rep

Nice update xD

Wednesday, September 14, 2016 at 4:07:06 PM
iceangel 33.9k rep

Thanks Scirra Team!

Wednesday, September 14, 2016 at 4:38:20 PM
gillenew 25.5k rep

nice update :)

Wednesday, September 14, 2016 at 4:40:21 PM
edisone 18.4k rep

awesome...ty so much

Wednesday, September 14, 2016 at 5:04:16 PM
glerikud 21.1k rep

Awesome. Great that you managed to push it into beta. Thank you. :)

Wednesday, September 14, 2016 at 5:10:18 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.