×

Discussion Board

Results 1 to 4 of 4

Thread: No caching.

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    1

    No caching.

    How do I do so that my pages does not cache on the visitors phone? If it does, the visitor won't know when the page has changed. I use php to create my pages if that gives any help.

    Also, I would like to know which phones can use the same applications. For example, if 3410 can use the same games, etc as 3510i.

    Thanks in advance!

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    334
    Hi!

    You can prevent the caching by adding the following headers to your php code:

    <?php
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    // always modified
    header("Cache-Control: no-store, no-cache, must-revalidate");
    // HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    // HTTP/1.0
    ?>


    Kind regards,

    sami / Forum Nokia Developer Support

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    5

    Re: No caching.

    Hi!

    This is a fairly (well ok very) old post but I hope my plea for help might bring it alive...

    No matter how I try (and I've tried the world) I cannot get caching to stop on a Nokia 7610. I have a very simple page which references a text file that is always changing:

    web page file "NextPage.php"
    ----------------------------

    <?php
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate(\"D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Content-type: text/vnd.wap.wml");
    echo "<?xml version=\"1.0\"?>";
    ?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN\" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    <head>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/>
    </head>
    <card id="index" title="MyPage" newcontext="true" ontimer="NextPage.php"><timer value="25"/>
    <?php echo file_exists ('page.txt') ? file_get_contents ('page.txt') : ' ' ?>
    </card>
    </wml>

    I get the first page of text and I can see the page "refresh" (flash) on the phone but it will not refresh to the next page of text. I have checked that the text file is changing on the web server and everything works when I use an Opera browser on my PC!.

    Please - has anybody got a hidden nugget of a suggestion?

    Best Regards!

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    3

    Re: No caching.

    One way to get around this is to append some sort of unique query string to the url on each request. I know this isn't the nicest approach, but it works, so there you go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×