Image Cache needs to be reloaded

Hi there,
I know there are a few issues reported on the forum but I’m not used to it that much. So I would have liked a more precise help.
I’m hosting a webiste at OVH, and using a php 7.4.

Basically, every time I upload an image, I need to reload the page to show it. When the front end is loaded, the image are not loaded either.
As soon as I check the image url, it tells me the image contains an error.

As I reload the page, the image appears completly fine.

I saw here it might be related to the php.ini not loading GD ressources but I have no clue where to check that in the files nor on my server.
Maybe here is my .htaccess but I’m not sure it’s related to that issue.

# Kirby .htaccess
# revision 2020-06-15

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder;
# otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite,
# set the RewriteBase to:
#
# RewriteBase /mysite

# In some environments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /

# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

# block all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]

# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]

# block direct access to Kirby and the Panel sources
RewriteRule ^kirby/(.*) index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# pass the Authorization header to PHP
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

My case is related to this one

On the forum, I saw you need to add that line to your nginx config,
error_page 404 /error;
but I’m pretty sure i’m running on apache and in my phpinfo, GD is running.
I also regenerated the media folder, checked any weird things in the config.
(Here is the config maybe I missed something?)

<?php 

return[
    'debug' => false,

    'panel' => [
        'css' => 'assets/css/custom-panel.css',
        'slug' => 'admin'
    ],

    'routes' => [
      [
        'pattern' => '/',
        'action'  => function () {
          $album = pages('projects')->children()->shuffle()->first();
          return go($album->uri());
          }
      ]
    ]
];

Thanks a lot for the help.

phpinfo() should show you on what webserver you are running. If you are not on Apache, the .htaccess would be of no use, because that it only works for Apache servers.

So, assuming your are on Apache, you don’t need any nginx related settings.

The thumbs not showing up on first load might be a caching issue. Do you have any active cache settings on the server?

What about the size of the the images? Does this happen with a Starterkit or your own project?

Hi texnixe,
the images seems to load using the starterkit…
I don’t have any active cache settings on my server.
I tried with all kind of files, quite big and quite tiny. Seems to generate the same issue…

On the same server? What about custom code/plugins?

Quick update - A plugin was not working correctly and needed to be updated.