1. Check out our companion app, Forums for Android! Download from Google Play

How to Prevent Caching in Browser

Discussion in 'Application Development' started by DroidDweeb, Mar 31, 2010.

  1. DroidDweeb

    DroidDweeb New Member
    Thread Starter

    Mar 31, 2010
    We have a web application geared towards mobile phones. It was originally targeted for the iPhone safari browser, but we would like to advertise that it is Android compatible as well.

    The webkit browser displays the pages well, but we're having trouble with the browser displaying out of date information from the cache. We're adding the usual response headers...

    Code (Text):
    1. response.setHeader("Cache-Control","no-cache");
    2. response.setHeader("Pragma","no-cache");
    3. response.setDateHeader ("Expires", -1);
    ...but the user has to refresh the screen for the app to make a request for updated information.

    Is there something specific that the Android browser looks for when deciding to pull a cached or fresh copy of a page?



Share This Page