With the new "file" action result, I create the controller to display some images in my ASP.NET MVC app. Was thinking about.
Something like this:
& lt; Img src = "/ photo / show / hello" alt = "hello" title = "hello" />
versus:
& lt; Img src = "/ photo / folder / Hello.jpg" alt = "hello" title = "hello" />
I'm curious what the effect of the display will be. Suppose I did not do anything, but returned the image file from the controller, is there any difference in calling the controller work versus the image, which is just coding the path in the source attribute?
However, to ensure small but measurable performance effect, the display is completely irrelevant. until it becomes highly relevant. So unless you have to walk on your server or your users have to wait to load their pages, and you have to start reducing, do not worry about performance.
DO Concerns: You will need to re-apply a caching strategy to the server, because the IIS management stays directly requested for static files. You will need to make sure that you manage your client-side caching with the right headers included in the response. Finally, just ask yourself if a server is searching for a way to serve stable files, which meets the requirements of your application.
Comments
Post a Comment