Specifying launchScreens and icons from cloudfront to reduce server load


#1

I was thinking of not bundling the launchScreens and icons in my app (to reduce my server’s load) and instead pointing to files hosted in S3 via Cloudfront.

Before:

App.launchScreens({
	'iphone': 'resources/splash/splash-320x480.png',
	'iphone_2x': 'resources/splash/splash-320x480@2x.png',
	...
})

After:

App.launchScreens({
	'iphone': 'https://d8723678rhc.cloudfront.net/launchscreen_iphone',
	'iphone_2x': 'https://d8723678rhc.cloudfront.net/launchscreen_iphone_2x',
	...
})

I’m inclined to think this will not work, since the path specified above is relative? I haven’t checked out the source yet, though, so it might be possible.
Then again, I probably don’t need to do this, since app installs are relatively unrepeated events. Or, the static-content load due to app installs << the static-content load due to accessing various pages in the app! Still, if anyone else wanted to try to do this, or if it is impossible, please share! Thanks.


#2

The app icons and launch screens need to be bundled with your app, so the resources are accessed as local files during build, not over the network.


#3

Do you know why that’s necessary? That’s how i’ve set it up, but it’d be nice if I could serve the images from a cdn


#4

That’s simply the way native apps work: app icons and launch screen are bundled with the app as part of the build process.


#5

I see. we’ll it’s not the end of the world!