0

My first Spring Boot app is nearly finished.

Except for one problem.

I have one site where I display a custom image to the user. It comes out of my MySQL database and is 4 to 8 MB big.

The site starts to load. Depending how fast the internet is more or less of the picture is downloaded.

And suddenly the browser (I tried in different) says no internetconnection (ERR-internet-disconnected).

I cannot find any error message in my logs and I don’t know if it is a server, MySQL or spring problem. I am using tomcat 8

Hope someone had the same issue and can tell me how to solve it.

maxi
  • 11
  • 2
  • Try adding spring.http.multipart.max-file-size=10MB to application.properties. I'm not sure if 'max response size' is even a thing but that error I saw it before when trying to upload a file bigger than the value defined in that property. Basically the server closes the connection when the request become bigger than the specified property value. – nyrd Jul 14 '17 at 07:28
  • Sounds like your hitting a read timeout in the embedded tomcat. Turn your server logs up to debug and watch out for error messages indicating disconnection and then look in the class that reported the error for properties that control timeouts. – Andy Brown Jul 14 '17 at 08:07
  • Thank you for your information. It only occurred on mobile devices and the problem was that I set the wrong Content length for the image. It seams that mobile browsers have some problems with the content length. – maxi Jul 14 '17 at 11:20

1 Answers1

0

My advice is , you can save all images in folder and save your image path in database. And you can show all images dynamically like this

If you want to improve performance you can look jquery lazy load.

mrtasln
  • 574
  • 1
  • 5
  • 18
  • I missed to say that the images i want to display are loaded from the database and not from the resources – maxi Jul 19 '17 at 14:38