View Full Version : HTML or ASPX?

01-28-2005, 08:48 AM
I am currently developing an image gallery site similar to www.thunda.com

My site is template driven, so if i change my template file, the site look and feel will change.

Looking at thunda.com, after choosing a province, then clicking on "pics", then selecting any event, a list of thumbnails appear - this page is an HTML page. I assume that when they uploaded their images, the page was dynamically created.

These images could be displayed this way, or using an aspx page which fetches image information from the database every time the page is viewed.

Currently i am using the latter option, but it seems a bit slow - i would imagine that the static html page would load faster because of no server side interaction.

Performance is a major concern with this site - what are my best options? Should i dynamically create an html file for each set of images i upload, or should i try and optomise my aspx page and display the images directly from the database?

Please let me know if i am being unclear about anything...

01-28-2005, 01:03 PM
Couldn't view ur site. It's censored by our firewall until after work. Anyway, to your question, I think it depends on how much space you've got. How large is the HTML file you want to create? Multiply the size of the HTML file by how many sets of images you'll be uploading.
Then weigh that with the amount of traffic you'll be having on that particular page. You will get a better idea.
It's always better to do everything dynamically though, and use aspx. Don't know aspx ... yet, but isn't it supposed to have better performance than classic ASP?

01-28-2005, 04:34 PM
just dynamically create it and set the cache controls on it so that it only generates it if it wasnt loaded in the last x minutes or whatever

i think you can also set them so that it caches it differently for each querystring (so it only re-generates it if the time has expired for that querystring)

i cant really remmember much about this, its all in the @ stuff at the top but i only ever used it once and it was for generating an image, and im not too good on asp.net :p

edit: also make sure you write your code in the most efficient way possible.. no offence but if you have to ask about efficiency, you probably arent

this involves keeping opjects open only as long as they are needed etc, using getrows to populate a 2d array instead of using movenext etc

01-29-2005, 04:13 AM
Good advice given so far. I would definitley choose the aspx route - just store the path to the image in the database and use that to load the image plus whatever else onto the page.

Probably your bottleneck in any case will be the physical size of the images.
If you have a page of thumbnails, be sure that you have them actually stored as thumbnails and aren't simply large image constrained by height and width html attributes.

Here is an example of such a thing done with PHP. .NET also allows you to resize images in such a way also - http://www.tcdesign.net/FarGalleries/index.php


02-03-2005, 04:33 PM
Thanks all for your replies - I have infact already implimented fragment caching which does drastically increase performance on the aspx page. I have unlimited storage on my server, so space is not an issue. The thunmbnails i am displaying are actual thumbnails which are generated when the images are uploaded through my content management system. Dont worry, no offence taken ghell - I would like to think i am quite efficient in my code though - I just asked the question because i am unsure about performance of .net under stressful conditions of high traffic... I think for now i will stick to the dynamic route, and later consider static page creation if performance problems arise...

Thanks again!