Last post Jan 09, 2008 10:35 AM by BluFire739
Jan 08, 2008 10:30 PM|BluFire739|LINK
This one has had me stumped for a while now. I hope someone out there can help.
I have image data and metadata that is retrived from the same place I would like to display this info with as little strain on the server as possible.
Currently what I have is working, but by no means the best possible solution. I have the first page which receives the request from the user, pulls the data from the Db and writes the metadata to various controls on the page. It then reads the image data
into a sessionstate variable and sets the src property of a aps:image control to another page "GetImage.aspx". This page will load the image data from the session state, convert the format or decrypt the image (if needed) and write the image data to the output
stream. Images are written to the same sessionstate object so its not that bad, but its still bad enough. Is there a better way (I thinking with a user control) to get the data to the user, or to pass the data to the next page? what would the performace differences
be with writing the image to disk?
Data Bound Control
dynamic ascx controls
Jan 09, 2008 05:54 AM|ca8msm|LINK
Why don't you just pass an id of the image to the GetImage.aspx page, and make that page responsible for retrieving the image? This would result in a second database call, but it would mean that the image data wouldn't be stored in session. I imagine that
strain on memory of holding the image data in session, would be a greater strain than a second database call.
This isn't a definite answer, and you would have to run some tests to find out, but I would have thought it would be a better approach. You could even extend this approach later, by caching (or by writing the image to a "temp" folder) any requested images
for a certain length of time and check to see if it exists there before going to the database.
Website Design Darlington - http://lessthandot.com -
Jan 09, 2008 10:35 AM|BluFire739|LINK
Thanks for your response. I was trying to avoid doing a second Db call, because, to retrieve the image, I actually have to load a byte() and parse it to get the imbedded image. I'm starting to think now writing the image to a disk cache, maybe even create
a custom cache providor for this, sence you mention it, there is a good possiblity of the same image being request a few times.
Again thanks for your response.