2 Replies Latest reply on Oct 4, 2005 1:19 PM by pckiller

    pictures are not loaded every time

    pckiller

      Hi,

      I have looked for a solution in the forum but I didn't find any similar problem (I am a beginner ^^). So I am posting here but I am not sure that is the good place. Sorry about that.

      I am using JBoss 3.2.7.

      The problem :

      I have a web application with 10 different pictures inside. Sometime Internet Explorer is not loading some of these and there is no Exception in the log file. I need these pictures to be displayed. The pictures are inside a zipped war file, which is in a zipped ear file.

      The problem doesn't seem to appear on firefox. I know, don't tell me to use it O_o, I have to use Internet explorer :(. The problem is appearing more often when the setting of the cache of Internet Explorer is "Every visit to the page".



      An experience :

      To see better the problem, I have created 2 sets of 100 different pictures. I have put one set in the ear file and another in an unzipped war directory in the deploy directory. When the two set of images are displayed in my web application and when the page is refreshed a lot, contrary to the first set of image (from the unzipped war directory) where there is no problem with the display, some of the second set are missing. That is happening randomly (the missing pictures can be different each time you are reloading).

      I have done this experience on different computers (client and server side) and the problem persists but the periodicity is different.

      It seems, there is a problem of translation between the URL of the picture and the path on the hard drive of the server. The pictures have more difficulties to be loaded from the temporary directory than from my war directory (in fact, more than more because there is no problem with the unzipped war directory).

      Is there any settings in the JBoss server that I could change to prevent this bug ?

      Yours,

      Eric

      PS : Sorry again if there is another post like that or if it is not the good place to post.

        • 1. Re: pictures are not loaded every time
          neelixx

          Eric,

          Is Internet Explorer using a proxy server? Also, you may want to include in your HTTP headers no caching.

          <%
          response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
          response.setHeader("Pragma","no-cache"); //HTTP 1.0
          response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
          %>

          Also, if you are using Internet Explorer 5, look at these links to see if you are affected:

          http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP
          http://support.microsoft.com/support/kb/articles/Q234/2/47.ASP

          Cheers,

          --Aaron

          • 2. Re: pictures are not loaded every time
            pckiller

            Hi Aaron. Thank you for your answer.

            IE is not using any proxy. "No caching" is not a solution. I have tried your header but I think the problem is not coming from the cache of the navigator. When I am setting internet explorer cache to "automatically" or "never", the problem seems to be resolved. But some times, on the first loading (with this setting), a picture can be missing.

            I have looked your links. It is the contrary. However, the cache could be a solution, I won't know the setting of Internet explorer of the users. That's why I was working in the worst case (setting of cache "Every visit to the page").

            I wanted to force the navigator to cache the picture and I have tried that too:

            <%
            response.setHeader("Pragma", "cache");
            response.setHeader("Cache-Control", "public");
            long expireTime = System.currentTimeMillis() + (7 * 24 * 3600 * 1000);
            response.setDateHeader("Expires", expireTime);
            %>

            It was the same problem, pictures are randomly missing but less often.

            The solution that I have found is completely different. I changed the structure of my web application and put the pictures in an uncompressed war file in the deploy directory. The remaining application stayed in the ear file...

            It seems to solve my problem. But it is not very beautiful O_o. I will let you know if I'm finding something better and thank you again for your quick answer ^^.

            Eric