You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2013/01/17 02:34:28 UTC
Setting Expires header on mountResource
Hello,
I am mounting a favicon using the following code in Application#init. How
do I control Expires headers when this image is served?
PackageResourceReference faviconReference = new
PackageResourceReference(MyResourceScope.class, "images/myfavicon.png");
mountResource("favicon.png", faviconReference);
Thanks,
Alec
Re: Setting Expires header on mountResource
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
This way the default (global) cache settings are applied.
See org.apache.wicket.settings.IResourceSettings#getDefaultCacheDuration
You will need custom ResourceReference that uses custom IResource to set
specific cache settings just for it.
Hint: you can extend PackageResRef/PackageResource
On Thu, Jan 17, 2013 at 3:34 AM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> I am mounting a favicon using the following code in Application#init. How
> do I control Expires headers when this image is served?
>
> PackageResourceReference faviconReference = new
> PackageResourceReference(MyResourceScope.class, "images/myfavicon.png");
> mountResource("favicon.png", faviconReference);
>
> Thanks,
>
> Alec
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>