You are viewing a single comment's thread from:

RE: Building a Hotel Management System With ASP.NET Core(#7) - Working With Images

in #utopian-io7 years ago (edited)

Nice tutorials. Do you use lazy load image on the project?
Also, I suggest that you store the image in the temporary file first then upload it to file server so the main server doesn't get bloated.

Sort:  

That's true, lazy loading is always good, but instead of lazy loading only the images I would say lazy load entire list of view, like load 10 room pictures at once and then when scrolling do others. What is the advantage of using temporary file, because storing it in both the places will not make the overhead of memory consumption, though if you upload it asynchronoulsy I do not think there is any problem.

Hey @codingdefined
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Thanks for your comment @drsensor.

Well, I haven't gotten to the part of the tutorial where images are fetched as navigation properties of other entities(that will be the next tutorial).

However, when images are to be loaded, eager loading or lazy loading will work just fine. Remember, I am not storing the image file in the database, only a string representing the file path.

Eventually though, eager loading would be a better approach as it would load every required related data in one query.

  • For the temporary storage, well, I am using and disposing the stream immediately the file write is done. So generally, there is no occurrence of server bloating. Also, making use of temporary files creates a problem when so many users are writing against the same temporary files folder. ASP.NET's core exception limit for concurrent usage of
    tempFiles is 65533(or thereabout). This becomes a problem when you have a large user base all performing their own actions against this same folder.

Wow, there is concurrent usage limit, thats new to me :o . It's been a while since I fiddle with ASP.NET (and now Core). Thanks for the info, I learn a lot. Looking forward for your next tutorials :)

Hey @drsensor
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!