Hi Dan,

Thanks for sharing this!

On 27/03/2013 6:24 PM, Dan Retzlaff wrote:
Hi, Bertrand. I don't have all your answers, but I can share my experience.

First, when you say you serve files out of webapp folder, do you mean
you're not using any ResourceReference? Just absolute paths from markup? I
think improving that is the first thing to do. You need to process resource
references in Java so you can introduce versions, CDN base URLs, etc.
To answer your question, here's what I use to access my webapp resources:
-ContextImage which uses context-relative urls
-RelativePathPrefixHandler which handles hrefs in the markup and makes them context-relative
-UrlResourceReference with, again, context-relative urls

The main caching problem we had was that after upgrades, some clients had
the old CSS cached and the site looked funky for them. So we went through
and made sure all CSS is served through PackageResourceReferences. Wicket's
default versioning strategy then did its magic and that complaint stopped.

With respect to @import, we have many @imports in our source LESS, but by
the time it's being served, the CSS is flat. So versioning that is enough.
It's possible but I think far less likely that this kind of caching problem
will happen for images and fonts. Direct references to these from our
application still go through ResourceReferences just so they can be served
from CDN, but we don't worry about relative-path includes from CSS.
What does LESS mean in the first line of the paragraph above?

Do you do anything special to "flatten" the css files?

So, to not "worry about relative-path includes from CSS", you must make the images non-versioned, correct? Do you do this using ResourceReferences and IStaticCacheableResource#isCachingEnabled() ?

If you use ResourceRefenrecs, does that mean that all your assets (css, js, images,...) are stored along with the java class files (i.e. src/main/resources in Maven terms) ?

Thanks again!
Bertrand

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

Reply via email to