service worker cache files with TWA app install

Viewed 73

I've successfully created a TWA application and it is working as expected! the .aab file is almost 2 MB in size.

I have some big files that the service worker caches on the install event, it would be desirable to include these files with the TWA application on google play so that they got installed with the app rather than waiting for the user to open the app to start another installing process.

is there a way to achieve this? or maybe a workaround where I let the service worker start caching right after the TWA app is installed on the device (before the user opens the app)?

1 Answers

Currently, there isn't a solution that will allow you to ship files with the .aab/.apk or trigger the Service Worker upon the application being installed.

There is a discussion about enabling shipping files with the application package, that would allow bootstrapping the application at https://crbug.com/816798. Please, do star the issue if that's interesting to you and share your use-case.

Related