Hi,

I'd like to serve user avatar pics. I can store them in blobstore. I
think I can modify the blobstore example to make it work like this:

    // sevlet which serves my images:
    public class Serve extends HttpServlet {
        private BlobstoreService blobstoreService =
BlobstoreServiceFactory.getBlobstoreService();

        public void doGet(HttpServletRequest req, HttpServletResponse
res)
          throws IOException {
            BlobKey blobKey = new BlobKey(req.getParameter("img_id"));
            blobstoreService.serve(blobKey, res);
        }
    }

    // user jsp page:
    <div>
      <img src='img?img_id=<%= myUsername %>'></img>
    </div>

this is all we really need, right? In my example, I can locate a
user's avatar image blob by using their unique username.

Is this a lot slower than just hosting the avatar on a static url like
on a php server for example?:

    <img src='some/path/johndoe.jpg' />

I'm worried that every time a user's avatar is served, the
BlobstoreServiceFactory.getBlobstoreService() method needs to be
called and then a fetch from the datastore must be done - if I have a
few dozen such images to locate on a single page, am I going to be in
trouble?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to