# Image load in the background?

**URL:** https://community.glideapps.com/t/image-load-in-the-background/13207
**Category:** Ask for Help
**Created:** [July 28, 2020, 2:49pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207 "2020-07-28T14:49:54Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 28, 2020, 2:49pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/1 "2020-07-28T14:49:54Z")

</div>

@mark i have an app where images is stored in cloudinary. Is there a way to load the images in the background so they are to show up without lag when they are to be presented? Or present all images in an inline list so they are all loaded. I’m doing that already actually but with 3 horizontal images at each row resulting in small images. I expect that the images are compressed for this view and therefore will not be available for the image component.

I have at present approx 400 images in the app but could go to 5000. The images are put in an image component.

---

<div class="post-metadata">

### Author: ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)
#### Post date: [July 28, 2020, 3:56pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/2 "2020-07-28T15:56:15Z")

</div>

You mean for the app to preload the images and store them on the user’s device?

We don’t have anything like that yet.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [July 28, 2020, 3:58pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/3 "2020-07-28T15:58:02Z")

</div>

@mark that was something like that, I meant. Any way to make the images load quicker - looking for suggestions.

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [April 7, 2021, 7:08pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/4 "2021-04-07T19:08:21Z")

</div>

I am trying to get this figured out now as images (even 350kb ones) can take a while to load (even on decent wifi).

Any update @Mark ? Thanks!

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [April 7, 2021, 7:26pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/5 "2021-04-07T19:26:37Z")

</div>

How would it work on the device if:…  
the user start using the app…  
they get to a screen where they need to type a few things in… be busy…  
can I then have the images in the row in the sheet… but hidden by visibility?  
And then are they in the cache to load faster?

Thanks!

---

<div class="post-metadata">

### Author: ![eltintero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eltintero/32/76520_2.png) [@eltintero](https://community.glideapps.com/u/eltintero)
#### Post date: [April 8, 2021, 2:37pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/6 "2021-04-08T14:37:48Z")

</div>

Are images stored in Glide or somewhere else?  
I think this should go to the feature request topic?

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [April 8, 2021, 2:46pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/7 "2021-04-08T14:46:15Z")

</div>

The URL for uploaded images and files is appspot - and [appspot.com](http://appspot.com) is the Google Cloud infrastructure.  
For me it is whether the images can be put in the cache early in the user process, so it is superfast later.

---

<div class="post-metadata">

### Author: ![eltintero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eltintero/32/76520_2.png) [@eltintero](https://community.glideapps.com/u/eltintero)
#### Post date: [April 8, 2021, 2:57pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/8 "2021-04-08T14:57:34Z")

</div>

Got it, I understand.  
Maybe add it to the features request topic, since Glide doesn’t do that currently.

---

<div class="post-metadata">

### Author: ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)
#### Post date: [April 8, 2021, 3:21pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/9 "2021-04-08T15:21:24Z")

</div>

@Mark_Turrell cache early/lazy cache etc.  
The challenge I think is for the glide app to find which images to cache at what stage.  
And also how long time the images can be cached - offline functionality would help a lot I think

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [April 8, 2021, 3:34pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/10 "2021-04-08T15:34:07Z")

</div>

my app has Row Owners… which means I do not really do lots of lookups in the app later, instead pulling everything into the CollectUser (profiles) sheet… for each person. I have 100+ columns as single values for strings, I pull in all the images I need, etc.

This allows me to always pull in User values wherever I want in the app.

And if Glide is caching images, potentially I am actually pulling them all in immediately anyway (maybe!)

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [February 3, 2022, 10:49am UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/11 "2022-02-03T10:49:33Z")

</div>

> [@Mark\_Turrell](#):
>
> images can be put in the cache early in the user process, so it is superfast later

@mark Do you know if there is any news regarding the preloading of the images, or some tricks to achieve the purpose of loading images superfast on the screen?

---

<div class="post-metadata">

### Author: ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)
#### Post date: [February 3, 2022, 12:01pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/12 "2022-02-03T12:01:45Z")

</div>

I decided to reduce the file size of images so that they are a lot faster to load normally. That helped a lot, so I have had fewer issues. I did have a hidden inline list component with images on an onboarding screen… but I could never tell in the end if it was faster or not, so I took it out.

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [February 3, 2022, 1:59pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/13 "2022-02-03T13:59:48Z")

</div>

Perhaps it is possible to integrate a preloading technique with CSS. I’ll experience it today and if it works I’ll let you know.

---

<div class="post-metadata">

### Author: ![Jason](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jason/32/14_2.png) [@Jason](https://community.glideapps.com/u/Jason)
#### Post date: [February 3, 2022, 4:49pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/14 "2022-02-03T16:49:51Z")

</div>

Preloading images would probably need to be something you tell Glide about explicitly. There are too many edge cases for us to accurately detect which images need to be preloaded for most/all users. Image preloads work best when they are placed into the initial HTML bundle. At this time we don’t have anything to comment on when or if this will be implemented.

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [February 3, 2022, 6:57pm UTC](https://community.glideapps.com/t/image-load-in-the-background/13207/15 "2022-02-03T18:57:47Z")

</div>

Thanks for your point Jason.

The idea, although not perfectly effective, was to define, in a rich text component, a div tag to apply an ::after pseudo element, for example like this:

```auto
<div class="myTest"></div>

<pre><span><style>

.myTest::after{
   position:absolute; width:0; height:0; overflow:hidden; z-index:-1; // hide images
   content:url(image1.jpg) url(image2.jpg); // load images
}

</style></span></pre>

```

If it worked, in a presentation detail screen, I could first preload the photos, and then after a preset wait, make them appear all together, on the same screen of course.

But it doesn’t seem to work… 🙂

🤷 🙆‍♂️ And oh well … it doesn’t matter, I tried!
