CSS Background-Url Performance Issues (TIL)

We’re currently building an Angular 4 + Cordova app for Android and iOS. One big feature is the photo upload, which takes multiple images, displays a preview and uploads it to the server.

To have a nice tiled image grid each photo gets loaded as a background image, setting the background-size to cover. This does look really nice, but with current smartphone cameras and 3MB+ images we had a very noticeable UI lag when navigating within our Angular Material Tab control.

Using an image tag works way better – unless you set the property object-fit: cover; which results in the same performance issues we encountered.

The list does not look as sleek as before, but the performance is just so much better now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.