0

First, I do not know what I should understand when we talk about "dynamic images"... but in my website (talk about movies - www.mananaseguro.com) I have to display the poster of each movie. So I think these images are considered dynamic images.

I do not know:

  1. If these images should be in the cache, and if yes what expiration date (GAE)?

  2. If these images should be in the public folder (GWT)?

  3. How to correctly refer to these images, I use setUrl("./MananaSeguro/posters/p1.gif") (GWT)?

  4. If my APPLICATION_SPRITE (that have all UI images) be in the cache (GAE)?

  5. I do not like to have all these images in ./client/resources/ directory. Is it possible to have them in the WAR directory to be more conformtable (if yes, how to configure it)?

  6. After that, I will use OBJECTIFY for my database, but the same kind of question occurs : Do you know in wich directory would I need to store these images (I will need to refer to their path inside the database)?

  7. I do not know GAE, but do you know if there is an interesting feature to store these images (Blobstore)?

4

1 回答 1

4
  1. Not sure if you're talking about Google memcache service or browser cache. The images should be stored in the browser cache (the required headers will be set by the image service when the images are served). The images should not be stored in the memcache service, that's for storing data that is fetched regularly and/or is expensive to fetch or calculate.

  2. The public (I assume you mean "war"?) folder is for static content, not dynamic. You'd need to re-deploy your application each time a movie was added if you stored movie images here.

  3. The Images service generates serving URLs from blobstore keys. These are the URLs you pass to setUrl on the client.

  4. The application sprite image should go in the public folder as it's static.

  5. This page describes how to specify which files/paths should be served statically from the WAR

  6. The dynamic images will be stored in the blobstore, so you just need to keep the blobstore key to retrieve them

  7. Yes the blobstore is what you're after. With the Images API doing a lot of the "heavy lifting" for you.

于 2012-07-27T01:11:20.173 回答