cache problem with firefox

Posted on 2006-06-08
Last Modified: 2008-02-01
hi guys,

i have a class to display images. after uploaded an image my jsp page calls this class. it works fine in IE to show the new uploaded image bu in firefox it does not work properly, it shows old images until reload the page. I added that line to prevent chaching but it doesnt work at firefox
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "private"); // HTTP 1.1
response.setHeader("Cache-Control", "no-store"); // HTTP 1.1
response.setHeader("Cache-Control", "max-stale=0"); // HTTP 1.1             

what should i do?

thanks in advance...      
Question by:ysnky
    LVL 92

    Accepted Solution

    trying adding a dummay param to the request to make the url unique
    for example by using a timestamp
    LVL 30

    Expert Comment

    What if you try with just:

    response.setHeader ( "Pragma", "no-cache" ) ;
    response.setDateHeader ( "Expires", 0 ) ;
    response.setHeader ( "Cache-Control", "no-cache" ) ;
    LVL 13

    Expert Comment


    Try to put "must-revalidate" :

    response.setHeader("Expires", "Mon, 12 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
    response.setHeader("Cache-Control", "post-check=0, pre-check=0");
    response.setHeader("Pragma: no-cache");
    LVL 9

    Author Comment

    thanks guys...

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now