We have two ways in which we can serve elements such as images, javascript, css.
- Static scope, for example, "/images/foo.png"
- JSF library that displays something like "/javax.faces.library/foo.png?ln=images"
The latter is similar to how everything happens in JSF. It is easy to do. There is a lot of support.
The first allows interesting tricks in a situation where performance is calculated. We can organize our server so as not to transmit / images to the servlet engine, but instead use something faster. In fairness, I should say that I do not know anyone who uses our software that did this, or how much it cost to have something like Tomcat or JBoss, static content on top of something native, such as Apache, and how much it costs from the cost of business logic which also continues to provide the application.
We hope that in both cases the images will be served for a long time so that the browser can cache them. I note that the JSF version has a part of the query string, so we hope that the browser does not decide that it knows better and refuses to cache. We need to look at some traces to see what happens.
So what to do? JSF libraries? Use especially support in things like h: outputScript and h: outputStylesheet? Or a site image area?
Thanks - Richard
source share