Topic
4 replies Latest Post - ‏2006-12-18T18:30:25Z by SystemAdmin
SystemAdmin
SystemAdmin
1140 Posts
ACCEPTED ANSWER

Pinned topic Refreshing cache in AJAX

‏2006-11-22T06:39:13Z |
Hi

I have actually 2 problem that I am facing right now.

problem 1:
I have developed my website using AJAX. When a user access my site all the files including html,CSS,XML and javascript geto loaded in the client PCs cache.
But the problem is if i update my XML or CSS, the user still uses the older version saved in their cache(unless they have cleared their cache). I have tried the 'expire' META tag but its no use. Can you tell me how can I make sure that my guests are getting the latest version of my site.

problem 2:
My AJAX site runs perfect in mozilla 1.7, firefox 2 and opera 9.02. But when I access it using IE6 it does not work perfectly. When i try to acess the mysql database using php, for each request it creates an instance of the result. But after some time when i want to see the updated record of the database, it still show that old version from the cache. One person suggest me to use javascript's date() function with my GET query string. But I cant understand how to do it.

Please help me if you know any solution to these two problem. Doing so you will really help me out of a very big problem.
Updated on 2006-12-18T18:30:25Z at 2006-12-18T18:30:25Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1140 Posts
    ACCEPTED ANSWER

    Re: Refreshing cache in AJAX

    ‏2006-11-22T06:42:18Z  in response to SystemAdmin
    oh one more thing. If you want to view the reference that I have used to build my site'sAJAX engine, please visit

    http://developer.mozilla.org/en/docs/AJAX:Getting_Started

    I have used exactly the same technique with both XML and PHP support
    • SystemAdmin
      SystemAdmin
      1140 Posts
      ACCEPTED ANSWER

      Re: Refreshing cache in AJAX

      ‏2006-11-22T13:40:40Z  in response to SystemAdmin
      In answer to #1, you can use the 'expires' and 'cache-control' http headers to force clients to always re-fetch the page.

      In answer to #2, you are going in the right direction to use the javascript date object. I do something like this:

      var dataUrl = "http://myservice.com/myxml.php?customer=foo";
      dataUrl += "&date="+((new Date()).valueOf());

      or

      dataUrl += "&date="+(Math.Random()*1000000);
      • SystemAdmin
        SystemAdmin
        1140 Posts
        ACCEPTED ANSWER

        WANTED: GIFTED/CREATIVE WEB DESIGNER

        ‏2006-12-18T18:30:25Z  in response to SystemAdmin
        WANTED: GIFTED/CREATIVE WEB DESIGNER
        Appoligies for going off topic, this is not spam it's an appeal for creativity.

        We're looking worldwide for an exceptional web developer/designer capable of creating an exciting fresh online e-commerce prescence. Our URL is already receiving massive hits pre US roll out.

        We already have a current stock inventory of $35M (and hoping to launch with excess of 100m USD) at a commission ratio of roughly 3-5%. (Check your calculator has the necessary capacity prior to attempting the potential value of your input).

        Go to http://www.holgatehouse.co.uk/application/form where you will find further information and an application link. Many thanks, Caroline Greeves UK marketing director.
  • SystemAdmin
    SystemAdmin
    1140 Posts
    ACCEPTED ANSWER

    Re: Refreshing cache in AJAX

    ‏2006-12-18T18:29:55Z  in response to SystemAdmin
    WANTED: GIFTED/CREATIVE WEB DESIGNER
    Appoligies for going off topic, this is not spam it's an appeal for creativity.

    We're looking worldwide for an exceptional web developer/designer capable of creating an exciting fresh online e-commerce prescence. Our URL is already receiving massive hits pre US roll out.

    We already have a current stock inventory of $35M (and hoping to launch with excess of 100m USD) at a commission ratio of roughly 3-5%. (Check your calculator has the necessary capacity prior to attempting the potential value of your input).

    Go to http://www.holgatehouse.co.uk/application/form where you will find further information and an application link. Many thanks, Caroline Greeves UK marketing director.