Hi Josh,

I don't quite understand what you mean...

My component is called "Poster" which renders an image. The TML of this
component is like this:

.....
${userPosterImageLink} 
.....

And the component code has a function "getUserPosterImageLink" return a
link:
        public Link getUserPosterImageLink() {
        return resources.createActionLink("userPosterImageURL", false, 
                        new Object[] {userPosterImageFilename});
        }
And there is that "onUserPosterImageURL" to return the StreamResponse. All
this doesn't involve the page, the page only declares the "<t:poster..."
component.

So what do you mean by letting the page to render the image? Do you mean
that every page will have the two functions above?? And what the poster
component needs to do then??

thx for your reply!

Ronald


joshcanfield wrote:
> 
> It sounds like you are using an action to render the image. What I did was
> had my image rendered by page instead of the component. The component just
> puts the img element into the page.
> 
> consider using expires instead or/in addition to cache-control
> 
> in your StreamResponse.
> 
>                 public void prepareResponse(Response response) {
>                     Calendar c = Calendar.getInstance();
>                     c.add(Calendar.MONTH, 1);
>                     response.setDateHeader("Expires",
> c.getTimeInMillis());
>                 }
> 
> Josh
> On Fri, Jul 18, 2008 at 1:53 PM, ronaldlee <[EMAIL PROTECTED]> wrote:
> 
>>
>> Hi,
>>
>> In my StreamResponse class I set the header like this:
>>
>> arg0.setHeader("Cache-Control", "max-age=3600, must-revalidate");
>>
>> I created a component responsible to render this StreamResponse, and this
>> component is being used in multiple pages. It appears that even though
>> the
>> function in my component returns the same image, the image is not cached
>> because the URL created also includes the "page" name at the beginning,
>> which makes the URL different from page to page even it is requesting the
>> same image.
>>
>> Any idea how this can be solved??
>>
>> thx!
>> Ronald
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-cache-image-created-by-StreamResponse--tp18537525p18537525.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-cache-image-created-by-StreamResponse--tp18537525p18537876.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to