You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Phillip B <ph...@gmail.com> on 2010/04/23 00:11:59 UTC

Caching static assets from markup

I have several images and other static assets that are specified in my
markup. The images are in an assets folder. Wicket is handling the URL
change from relative to absolute. The issue is that there are no cache
related headers on the images, so the browser never caches them. Is
there a way to add these headers? I'd rather not move all image URL's
to the Java code. Or is there a better way to handle this?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Caching static assets from markup

Posted by Igor Vaynberg <ig...@gmail.com>.
RelativePathPrefixHandler takes care of making sure all static urls
stay context-relative.

-igor

On Fri, Apr 23, 2010 at 6:11 AM, Phillip B <ph...@gmail.com> wrote:
> So images in WebContent/images that are in markup as <img
> src="images/hi.jpg" /> aren't passed through Wicket? Does Wicket just
> prepend the base URL when the page is built? What class(es) manage
> this behavior?
>
> On Fri, Apr 23, 2010 at 7:34 AM, Martijn Dashorst
> <ma...@gmail.com> wrote:
>> If the images are in your context there's nothing Wicket does to serve
>> them. Your container handles those resources. See your container's
>> documentation for cache headers and such.
>>
>> Martijn
>>
>> On Fri, Apr 23, 2010 at 12:11 AM, Phillip B <ph...@gmail.com> wrote:
>>> I have several images and other static assets that are specified in my
>>> markup. The images are in an assets folder. Wicket is handling the URL
>>> change from relative to absolute. The issue is that there are no cache
>>> related headers on the images, so the browser never caches them. Is
>>> there a way to add these headers? I'd rather not move all image URL's
>>> to the Java code. Or is there a better way to handle this?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.4 increases type safety for web applications
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Caching static assets from markup

Posted by Phillip B <ph...@gmail.com>.
So images in WebContent/images that are in markup as <img
src="images/hi.jpg" /> aren't passed through Wicket? Does Wicket just
prepend the base URL when the page is built? What class(es) manage
this behavior?

On Fri, Apr 23, 2010 at 7:34 AM, Martijn Dashorst
<ma...@gmail.com> wrote:
> If the images are in your context there's nothing Wicket does to serve
> them. Your container handles those resources. See your container's
> documentation for cache headers and such.
>
> Martijn
>
> On Fri, Apr 23, 2010 at 12:11 AM, Phillip B <ph...@gmail.com> wrote:
>> I have several images and other static assets that are specified in my
>> markup. The images are in an assets folder. Wicket is handling the URL
>> change from relative to absolute. The issue is that there are no cache
>> related headers on the images, so the browser never caches them. Is
>> there a way to add these headers? I'd rather not move all image URL's
>> to the Java code. Or is there a better way to handle this?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.4 increases type safety for web applications
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Caching static assets from markup

Posted by Martijn Dashorst <ma...@gmail.com>.
If the images are in your context there's nothing Wicket does to serve
them. Your container handles those resources. See your container's
documentation for cache headers and such.

Martijn

On Fri, Apr 23, 2010 at 12:11 AM, Phillip B <ph...@gmail.com> wrote:
> I have several images and other static assets that are specified in my
> markup. The images are in an assets folder. Wicket is handling the URL
> change from relative to absolute. The issue is that there are no cache
> related headers on the images, so the browser never caches them. Is
> there a way to add these headers? I'd rather not move all image URL's
> to the Java code. Or is there a better way to handle this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org