Reducing the OPK size
As explained in the SDK introduction section, OPK files are Overwolf's app installation package which includes your app's files: the manifest, source files and other assets. All files are packed in a package which has the OPK file extension.
Why do we want to reduce OPK size?
Most of the time, basic compression is enough, and the OPK weighs between 1-3 Mb. But sometimes heavy assets push that higher, and the OPK can easily grow to more than 5Mb.
This is a potential issue - heavy packages will take more time to release and download, and run some extra risk of things going wrong under pressure - imagine thousands of users needing to download larger files simultaneously.
Moreover, it's a standing policy for us to minimize our footprint and requirements on the user's resources, storage and/or processing power.
How can we reduce OPK size?
We suggest several proven ways to keep OPK size manageable:
-
Compress images to weigh as little as possible with JPEGMini, TinyPNG or a similar tool.
-
Remove non-critical JavaScript from your app to reduce transmission times, CPU-intensive compiling and potential memory overhead.
-
Remove map files before zipping (*.map).
The Developer tools in Firefox/Chrome are using the maps to link the minified JS/CSS generated files to the original JS/CSS to allow debugging as if the code was not compressed. -
Reduce font sizes.
Most fonts that are used for large bodies of text are usually quite small in file size, especially if you are using a font delivery service like google fonts. Sometimes, however, designers include fonts that can be over 500KB. In these cases, you’ll need to reduce the character set's weight yourself. More info here. -
Remove .DS_Store files.
These files are proprietary Mac/OSX system files which hold attributes/meta-data about the folder it resides in. You're safe to just delete it. -
Remove .git, node_modules etc. Remove anything that is not required to run the OW app.
-
Serve assets through a CDN. If you have a large list of images, for example League of Legends champion tiles, upload them somewhere and make your app download them on demand. If you use AWS, you can upload them to a S3 bucket and set up a CDN using Cloudfront. Make sure that downloading the assets during a game does not put a heavy load on the client's connection speed, to avoid causing unnecessary spikes in ping.
If you have more ideas on how to reduce OPK size, please click on the EDIT button on the right, and add it in for everyone's benefit.