-
1. Re: s:graphicImage browser cache problem
danielc.roth Sep 23, 2008 2:03 PM (in response to gregtk) -
2. Re: s:graphicImage browser cache problem
gregtk Sep 23, 2008 4:01 PM (in response to gregtk)Thank you for your response :) Can I help to add this feature? Now I just write temporary solution with servlet which add to response data header next information.
Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.YEAR, 1); response.setDateHeader("Expires", calendar.getTimeInMillis());
I think if I add this lines to render of <s:graphicsImage> tag and bind with attribute like <s:graphicsImage cache=
true
> it helps to resolve cache problem. What do you think about it?
-
3. Re: s:graphicImage browser cache problem
danielc.roth Sep 23, 2008 6:55 PM (in response to gregtk)You have to use the filename tag for this to work at all (otherwise the image will get a random generated namne).
Cache=true is not really good since if you change transformImageSize (or add/modify any other transformes) the browser will not update the image, given that you have set the expires date to the future. Also, if you use the image in another place, with other transforms, you will have the same problem...
-
4. Re: s:graphicImage browser cache problem
danielc.roth Sep 23, 2008 7:04 PM (in response to gregtk)My approach works like this:
<s:graphicImage cachable="true" cacheKey="#{expression that is unique}" dirty="#{expression that determines if the original image has changed}"/>
Then the code, if cachable=true and pojocache is
on
will put the transformed image in the cache, if not already there with given key. If dirty evaluates to true, the cached image is re-cached. The key is made up so that different transforms don't conflict. The key can also be used to remove the image frim cache progamatically. Typical key might befileName-height-width
-
5. Re: s:graphicImage browser cache problem
gregtk Sep 24, 2008 5:09 AM (in response to gregtk)Yeah! that's very good idea. I think that's more intelligent than mine.