# StarterKit : images display only after reload page in the browser

**URL:** <https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693>\
**Category:** Questions\
**Tags:** v3\
**Created:** [April 6, 2019, 6:00pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693 "2019-04-06T18:00:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 6, 2019, 6:00pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/1 "2019-04-06T18:00:25Z")

</div>

Hi,

I have deploy the starterkit package on Nginx with php 7.2. The installation is ok but i have a little bug with images.

After delete media directory for regenerating files, when i launch the homepage or anyone page with image, this one is not displaying.

 ![image_off](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/e/e2a89793367b09e6296df4f45c7b878a05779758.jpeg)

–

**I must reload page for show image**

–

 ![image_on](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/3/3b5af4c17b36415b26318fc9b00f183193be355e.jpeg)

The images is generated after at the first load of the page, i think is normal behavior, but the page is not supposed to waiting request of generating image for loading in browser ?

My Nginx configuration :

```
   location / {
            try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
            try_files $uri = 404;
            fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }

```

Anyone have idea ?

Thanks,

---

<div class="post-metadata">

**Author:** ![notapro](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@notapro](https://forum.getkirby.com/u/notapro)\
**Post date:** [April 8, 2019, 11:44am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/2 "2019-04-08T11:44:00Z")

</div>

hello, have you solved your problem?

if not, this could be a permission problem.  
check the user who is running the application.

```auto
ps aux | grep nginx

```

check the user who is having the file permissions.

```auto
ls -la

```

maybe the rights do not match.

the host conf snippet seems okay.

good luck

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 9, 2019, 8:25am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/3 "2019-04-09T08:25:55Z")

</div>

For another testing, i have deploy on a VPS instance with same configuration (Nginx + PHP 7.2) That work correctly.

My problem is on my Rasberry (Using for devlopement) with same configuration (Nginx + PHP7.2), From your last message, i have verify the access rights on directorys, i have always the problem after update user / group on directorys.

Do you think 1GB on rasbery can be is the problem ?

This afternoon i go compare Phpinfo on Rasberry and the VPS instance, because except the OS i don’t see where is difference configuration for this problem.

Thanks

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [April 9, 2019, 9:04am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/4 "2019-04-09T09:04:26Z")

</div>

How much ram is allocated to PHP on the Raspberry?

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 9, 2019, 2:49pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/5 "2019-04-09T14:49:37Z")

</div>

I have try different tests with the VPS instance and the Raspberry.

Firstly, the VPS instance has php 7.2 and 7.1 and my kirby directory use the 7.1-fpm version in the Nginx config.

So, i have install the 7.1 version on the Raspberry with same config on the php.ini but the problem with loading image stay similar.

I have 128m memory allocated to php on the VPS and Raspberry

I see new release for Kirby is avaible (3.1.1 -\> 3.1.2) i think is not the solution but i go try it.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 9, 2019, 2:53pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/6 "2019-04-09T14:53:10Z")

</div>

Does the Rasperry actually generate the thumbs at the right size?

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 9, 2019, 3:53pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/7 "2019-04-09T15:53:59Z")

</div>

Yes image is generated with the right size but after reload the page, on the first load, on chrome i have 404 error on image url.

I think Kirby allow request of page before the thumbs generating is finished

A option for generate all media cache in the backend exist ?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 9, 2019, 4:15pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/8 "2019-04-09T16:15:03Z")

</div>

> [@Theo](#):
>
> A option for generate all media cache in the backend exist ?

No, you’d need a crawler that goes through all pages and all src/srcset/data-src attributes to generate all thumbs at all sizes.

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 10, 2019, 3:25am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/9 "2019-04-10T03:25:37Z")

</div>

Thanks for information,

If anyone succeeds to install Kirby on Raspberry, i’m interested 😉

For the next days i go reinstall the Raspberry to deploy with Apache configuration and see if that correct my problem.

---

<div class="post-metadata">

**Author:** ![moeli](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/moeli/32/8964_2.png) [@moeli](https://forum.getkirby.com/u/moeli)\
**Post date:** [April 10, 2019, 8:40am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/10 "2019-04-10T08:40:55Z")

</div>

I think you can also go through the media folder and use the information in the .json files in the .jobs folders. All information about intended thumbs should be there.

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 11, 2019, 8:40am UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/11 "2019-04-11T08:40:12Z")

</div>

Reply from this post : [Problem with Image cache - #13 by texnixe](https://forum.getkirby.com/t/problem-with-image-cache/13713/13)

> [@Problem with Image cache](https://forum.getkirby.com/t/problem-with-image-cache/13713/13):
>
> As far as I understand, @gplopes uses Mamp with the default Apache server? And you, @Theo, only experience this issue on your Raspberry, but not on your VPS, both running Nginx, right? Have you tested running your Raspberry with Apache yet?

True, i go to try soon with Apache for see  
|

> [@Problem with Image cache](https://forum.getkirby.com/t/problem-with-image-cache/13713/13):
>
> What about memory settings? Cache settings?

I don’t know how i can verify  
|

> [@Problem with Image cache](https://forum.getkirby.com/t/problem-with-image-cache/13713/13):
>
> Somehow it does indeed seem as if generating the images was too slow for some reason. But I can hardly imagine this happening with a single file only in a Mamp environment with standard Mamp settings, unless the images are really huge.

Personnaly, i use default images of starter kit  
|

> [@Problem with Image cache](https://forum.getkirby.com/t/problem-with-image-cache/13713/13):
>
> However, the whole purpose of generating thumbs asynchronously in Kirby 3 is to circumvent those memory issues that can happen when generating thumbs for many images or generating many image sizes.

I support this functional choice, it is standard to most cache systems  
|

> [@Problem with Image cache](https://forum.getkirby.com/t/problem-with-image-cache/13713/13):
>
> @Theo, @gplopes  
> When exactly are the images generated, before you actually reload the page or really only on the second load?

Step by step :

1. I delete the media directory, i go to load the page  
 ![k1](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/0/096c1fae87cbf27d20508140007f2f838d64b806.jpeg)

* * *

1. I look the source and see 404 error on the image  
 ![k2](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/6d6df197c48c0b47b60d27a267865808c6d88e97.jpeg)

* * *

1. I go verify on the media folder on the server, the image has been generated  
 ![k3](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/a/af344188e4d253d92e18cf52d94d82a80ce7e3eb.jpeg)

* * *

1. I reload the page, the image is here and no 404 error  
 ![k4](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/b/b2281f8fa347f0e08be4effe990de91b2d94e0fc.jpeg)

* * *

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 11, 2019, 6:35pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/12 "2019-04-11T18:35:29Z")

</div>

You might want to check if this solution also works for you on Nginx: [No thumbnails generated on Nginx](https://forum.getkirby.com/t/no-thumbnails-generated-on-nginx/13534/9)

---

<div class="post-metadata">

**Author:** ![Theo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/theo/32/6510_2.png) [@Theo](https://forum.getkirby.com/u/Theo)\
**Post date:** [April 14, 2019, 11:01pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/13 "2019-04-14T23:01:46Z")

</div>

Finally it works ! 🙂

I have try with apache and i had same problem. Strangely I did not have the mention GD in my phpinfo (), so i have install it.

The starterkit work fine now, but i don’t know why PHP could generate the images on reload without GD library.

---

<div class="post-metadata">

**Author:** ![steirico](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/steirico/32/5466_2.png) [@steirico](https://forum.getkirby.com/u/steirico)\
**Post date:** [December 28, 2019, 1:12pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/14 "2019-12-28T13:12:50Z")

</div>

A bit late, but my experience is hardly related and the solution might be useful for others, too.

I experienced that medias served for the very first time were “polluted” with a preceding newline character. Amongst others, this lead to broken image files served with a `200 HTTP Code` . Due to caching headers sent by my provider’s server, these files we not reloaded for some time and the broken images were used instead.

The superfluous newline character was introduced by one of my plugin’s files starting with a newline followed by the `<?php` tag. Removing the newline solved the issue.

---

<div class="post-metadata">

**Author:** ![mickaeldurand](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mickaeldurand/32/8022_2.png) [@mickaeldurand](https://forum.getkirby.com/u/mickaeldurand)\
**Post date:** [January 2, 2023, 4:44pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/15 "2023-01-02T16:44:59Z")

</div>

I have the same problem, the images are only displayed after reloading the page.

After deleting the contents of the media folder (bad idea).

I have to go back to each page and reload for it to generate the images for me.

However, they have the status 200.

I’m on kirby 3.8.2.

The problem arises on the local in mamp php 8 and on the server (apache) with php 8.1.

Is there a command to tell kirby to browse the whole site to generate all the images?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 2, 2023, 4:48pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/16 "2023-01-02T16:48:14Z")

</div>

How about using the Janitor plugin: [GitHub - bnomei/kirby3-janitor: Kirby 3 Plugin for running commands like cleaning the cache from within the Panel, PHP code, CLI or a cronjob](https://github.com/bnomei/kirby3-janitor)

It has a method to generate all thumbs.

---

<div class="post-metadata">

**Author:** ![mickaeldurand](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mickaeldurand/32/8022_2.png) [@mickaeldurand](https://forum.getkirby.com/u/mickaeldurand)\
**Post date:** [January 2, 2023, 4:57pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/17 "2023-01-02T16:57:20Z")

</div>

I will try this plugin.

On the other hand, what is strange is that if I take a starterkit in 3.8.3 and I delete the media folder. The images are displayed immediately.

Whereas on my project it is necessary to reload the page. Surely there is a problem somewhere.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 2, 2023, 5:01pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/18 "2023-01-02T17:01:04Z")

</div>

I don’t think there is a difference between 3.8.2 and 3.8.3 regarding thumbs.

Do you use any plugins in your project?

---

<div class="post-metadata">

**Author:** ![mickaeldurand](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mickaeldurand/32/8022_2.png) [@mickaeldurand](https://forum.getkirby.com/u/mickaeldurand)\
**Post date:** [January 2, 2023, 5:22pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/19 "2023-01-02T17:22:26Z")

</div>

I found the culprit. As soon as I remove the “programmable-blueprints” plugin folder.

> [@Programmable blueprints](https://forum.getkirby.com/t/programmable-blueprints/27417/6):
>
> That is a bit repetitive, and can be shortened to: Kirby::plugin('cookbook/programmable-blueprints', ['blueprints' =\> ['site' =\> function () { $user = kirby()-\>user(); // Si l'utilisateur est deconnecté if(! $user || ! in\_array($user-\>role()-\>name(), ['admin', 'editor', 'editor\_stories'])) { return Data::read(\_\_DIR\_\_ . '/blueprints/site.circuits.yml'); } // Si l'utilisateur est connecté return…

Pictures work.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 2, 2023, 5:25pm UTC](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693/20 "2023-01-02T17:25:59Z")

</div>

Interesting. Can’t reproduce this in a Starterkit though.

[Next page](https://forum.getkirby.com/t/starterkit-images-display-only-after-reload-page-in-the-browser/13693.md?page=2)
