This component lets you optimize static files downloading on Java servers like Tomcat. For example, rather than serve static files (e.g. favicon, background etc.) with default Tomcat servlet you can read the whole file once during the first request and return its content right from the memory after that. In the high load systems it saves a lot of server's resources actually. How to use it: 1) download staticfilePackage.jar and save it in WEB-INF/lib 2) describe StaticFile servlet in web.xml file. You have to provide an
initial parameter - file for the processing. An optional parameter mime lets you define mime
type settings for your file. By default servlet calculates mime type depends on file extension.
E.g. for favicon file:
3) define a mapping. E.g. for your favicon
and now the described file will be cached and served from the memory. And for the several static files just repeat
this description several times with the different names. Actually this component works as a constant cache for the default
servlet.
For downloading:
servlet: staticfilePackage.jar
See also JSOS - the largest collection of servlets and filters.
|
Also in JSOS:
|