User Graphic Suggestions

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

The Website I'm developing allows some users to upload a custom header
image, which is seen by that user and all users signed up by that user.

I'm trying to decide the most efficient way to handle this. I don't want to
hit the database to get the image every time I render a page, and I don't
think I want an image stored in memory for every user online. Caching just
doesn't seem useful here as each user online could potentially be seeing a
different image.

One thought I'm having is to actually store the image in a file folder with
a name that matches the user's ID, and then I could just reference that
image from my HTML.

I'd be curious to see if anyone else had some ideas on this.

Thanks.
 
Jonathan Wood said:
The Website I'm developing allows some users to upload a custom header
image, which is seen by that user and all users signed up by that user.

I'm trying to decide the most efficient way to handle this. I don't want
to hit the database to get the image every time I render a page, and I
don't think I want an image stored in memory for every user online.
Caching just doesn't seem useful here as each user online could
potentially be seeing a different image.

One thought I'm having is to actually store the image in a file folder
with a name that matches the user's ID, and then I could just reference
that image from my HTML.

I'd be curious to see if anyone else had some ideas on this.

Assuming that the individual images are going to be the same size or very
nearly, I'd probably do the following:

1) Store the various images in a subfolder

2) At Session_Start, work out which image is to be used and store its name
as a session variable

3) Use a MasterPage with an image control which is populated from the
session variable
 
Mark,
Assuming that the individual images are going to be the same size or very
nearly, I'd probably do the following:

1) Store the various images in a subfolder

2) At Session_Start, work out which image is to be used and store its name
as a session variable

3) Use a MasterPage with an image control which is populated from the
session variable

Yep, I had figured on all those. (Although for #2, I may just have a static
method the gets the image filename and have that method check if it's
already stored in a Session variable.)

I just barely came up with the idea of storing the image on disk instead of
in the database and was just trying to think it through. One concern is that
image files could get orphaned from deleted users but I could take steps to
check that.

Thanks.
 
Back
Top