0
votes

what does this mean exactly in Jetty Server Configuration ??

<init-param>
      <param-name>cacheControl</param-name>
      <param-value>max-age=3600,public</param-value>
</init-param>

As per the documentation in Jetty , its states that

cacheControl If set, all static content will have this value -->

Could anybody please tell me what does this mean ??
Means that even though changes are done to the JSP file , it will not get affected ??

Please let me know , thanks in advance .

I have this under the web.xml for the DefaultServlet , could you please tell me what data does this cache ??

 <servlet>
      <servlet-name>default</servlet-name>
      <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
      <init-param>
           <param-name>mimeTypes</param-name>
         <param-value>text/javascript,text/css,audio/mpeg</param-value>
         <param-name>cacheControl</param-name>
         <param-value>max-age=435677,public</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
   </servlet>

Could anybody please tell me what does serving static content mean ?? and why this is useful ??

Means why do we need a Servlet for accessing a static resource ?? cant it done directly ??

1

1 Answers

0
votes

That init-param is not 'server configuration' but 'servlet configuration' for the DefaultServlet. If you are using that to serve out static content then anything served out by that default servlet will have that cacheControl value applied to it.

JSP's are not served by the default servlet, they are served by a jsp servlet mounted and listening on another context.