Thanks, Jan!

I used the following init-params to resolve the issue of caching and locking:

  <init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value> <!-- to prevent file locking on Windows -->
  </init-param>
  <init-param>
    <param-name>etags</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>cacheControl</param-name>
    <param-value>no-cache</param-value>
  </init-param>


Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 3/9/2017 11:21 PM, Jan Bartel wrote:
Igal,

re your locked files on Windows, have a read of this page: https://www.eclipse.org/jetty/documentation/9.4.x/troubleshooting-locked-files-on-windows.html

BTW, the AnnotationConfiguration should come just before the JettyWebXmlConfiguration in the list of configs (its not the cause of your problem, just pointing it out).

Jan


On 10 March 2017 at 16:22, Igal Sapir <[email protected] <mailto:[email protected]>> wrote:

    Greg,

    >I don't think it is the jetty cache, as that only applies to
    static content rather than JSPs.

    To further clarify, I am talking about static content (JavaScript
    file), and not JSP.


    Igal

    On Thu, Mar 9, 2017 at 9:01 PM, Igal Sapir <[email protected]
    <mailto:[email protected]>> wrote:

        It looks like the headers are sent properly using the etag and
        cacheControl init-params of the DefaultServlet.

        But the DefaultServlet keeps a lock on my files (running on
        Windows) and most times I can not modify them without
        restarting the Jetty (sometimes it allows me to do it for some
        reason).

        Is there a setting that would allow me to not lock the files?


        On Thu, Mar 9, 2017 at 8:41 PM, Igal @ Lucee.org
        <[email protected] <mailto:[email protected]>> wrote:

            Hi Greg,

            Thank you for your reply.

            My embed code actually defines a web.xml descriptor with
            the following relevant snippet:

                <!-- Default Jetty Servlet for static content and
            directory listings !-->
                  <servlet>
            <servlet-name>default</servlet-name>
            
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
            <init-param>
            <param-name>dirAllowed</param-name>
            <param-value>true</param-value>
                    </init-param>
                  </servlet>

            <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>/</url-pattern>
            </servlet-mapping>

            Following your lead of checking the descriptor I found this:
            
http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/servlet/DefaultServlet.html
            
<http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/servlet/DefaultServlet.html>

            Which references settings like:

                maxCacheSize : 0 for no cache
                cacheControl : If set, all static content will have
            this value set as the cache-control header.

            I will try to either of those and hopefully that's all I need.

            Thanks,

            Igal Sapir
            Lucee Core Developer
            Lucee.org <http://lucee.org/>

            On 3/9/2017 7:49 PM, Greg Wilkins wrote:
            Igal,

            I don't think it is the jetty cache, as that only applies
            to static content rather than JSPs.
            It is probably the configuration of the JSP Servlet,
            which would be in the webdefault.xml descriptor included
            in the jetty-servlet.jar

            The other thing to check is that it is not the browser cache.

            regards


            On 10 March 2017 at 12:25, Igal @ Lucee.org
            <[email protected] <mailto:[email protected]>> wrote:

                Hi,

                How can I disable the caching of static content in
                embedded Jetty?

                My embed code is like so (removed unrelated lines):

                WebAppContext webapp =new WebAppContext();
                webapp.setConfigurationClasses(new String[]{

                     "org.eclipse.jetty.webapp.WebInfConfiguration" ,"org.eclipse.jetty.webapp.WebXmlConfiguration" 
,"org.eclipse.jetty.webapp.MetaInfConfiguration" ,"org.eclipse.jetty.webapp.FragmentConfiguration" 
,"org.eclipse.jetty.webapp.JettyWebXmlConfiguration" ,"org.eclipse.jetty.annotations.AnnotationConfiguration" });
                Server server =new Server();
                server.setHandler(webapp);
                WebSocketServerContainerInitializer.configureContext(webapp);
                server.start();

                The problem is that I have a javascript file that is
                not updating when I modify it.  The browser (Chrome)
                keeps showing "200 (from cache)" and the contents are
                unchanged.

                Any ideas? TIA!
--
                Igal Sapir Lucee Core Developer Lucee.org
                <http://lucee.org/>

                _______________________________________________
                jetty-users mailing list [email protected]
                <mailto:[email protected]> To change your
                delivery options, retrieve your password, or
                unsubscribe from this list, visit
                https://dev.eclipse.org/mailman/listinfo/jetty-users
<https://dev.eclipse.org/mailman/listinfo/jetty-users> -- Greg Wilkins <[email protected]
            <mailto:[email protected]>> CTO http://webtide.com

            _______________________________________________
            jetty-users mailing list
            [email protected] <mailto:[email protected]>
            To change your delivery options, retrieve your password, or 
unsubscribe from this list, visit
            https://dev.eclipse.org/mailman/listinfo/jetty-users
            <https://dev.eclipse.org/mailman/listinfo/jetty-users>

    _______________________________________________ jetty-users
    mailing list [email protected]
    <mailto:[email protected]> To change your delivery options,
    retrieve your password, or unsubscribe from this list, visit
    https://dev.eclipse.org/mailman/listinfo/jetty-users
<https://dev.eclipse.org/mailman/listinfo/jetty-users>
--
Jan Bartel <[email protected] <mailto:[email protected]>>
www.webtide.com <http://www.webtide.com> /Expert assistance from the creators of Jetty and CometD/

_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to