Stop looking for an image if it's not in the database (lots of 404 errors)

I’m about to go live with a new Wappler-built site but have hit a problem.

The database stores filenames of images. The search page shows all the records and the related images. I have put in a ‘Show’ Dynamic Attribute to only show the image if the filename is in the database. Visually this works fine. However, in the dev console I’m seeing loads of 404 errors.

It gets more serious because lots of 404s are triggering the server rate limiting to protect it against brute force attackers or vulnerability scanners so, as a result, I’m getting 429 errors fairly frequently as the server is forcing a short break.

How can I prevent the images from even being attempted if there isn’t a value in the database? The console shows it attempting to download /images/recordid/ whereas a record with an image stored would download /images/recordid/image.jpg.

I hope that makes sense. I thought that putting in a ‘Show’ attribute would sort this.

Help!

Community Page
Last updated: