Results 1 to 6 of 6

Thread: client machine not reflecting changes on server

  1. #1
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default client machine not reflecting changes on server

    Hello,

    Every once in a while, I have to tolerate something intolerable. I make a change to a website and the change doesn't show up on the client side. This occurs across browsers and it occurs even after I've deleted my browsing history. I've been told that sometimes the client machine goes only so far as a proxy server, and if the proxy server hasn't been updated as to the changes uploaded to the source server, those changes will not be reflected on the client machine.

    I would like to know, first, if this is true, and second, if it is, how can I either prompt the proxy server to update or bypass the proxy server and go directly to the source.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    this is sometimes true. some solutions:

    1) best solution is to configure your server to send the proper headers along with your pages, indicating that they should not be cached, or setting an expiry date for them. Contact your web host to determine the best way to do this (or, if you're using PHP or another server-side language, you can send the proper headers in your script).

    2) if it is just you wanting to see the changes as you make them (to make sure they're correct!), you can simply add a nonsense query string to the URL: instead of asking for
    Code:
    http: //www.example.com/mypage.html
    , ask for
    Code:
    http: //www.example.com/mypage.html?query=gibberishorwhatever
    passing a unique query along should make the browser and proxy treat it as a unique request, and not serve the cached page.

  3. #3
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    Neither one of those seems to be working.

    Here's what I put in my header:

    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

    The problem may be complicated by the fact that its a java webstart application that I'm updating. Is it possible that the no-cache and the query work on retrieving client side scripts and whatnot but not necessarily server side applications?

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I'm sorry; I didn't mean a <meta> element in the page head. You need to configure your server to send an http header.

    as far as server-side apps go: no, the query "tricks" the browser/proxy into thinking that it is a unique page request, while the no-cache headers inform the browser/proxy that it should never save to the cache (it is just a suggestion, however; the browser/proxy still does whatever they like).

    if your server gets the request, it should run the script anew. I can't think of any reason that your server would send a cached copy - unless your host does something screwy. Caching would more likely occur downstream, either by the browser or proxy/ISP.

    It is java, correct (not javascript)? If you're talking about a java app, that runs on the client's machine, then it would be more dependent on the java program.

  5. #5
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by traq View Post
    It is java, correct (not javascript)? If you're talking about a java app, that runs on the client's machine, then it would be more dependent on the java program.
    Yes, it runs on the client machine, but it is retrieved from the server. It is Java, not Javascript. They call it Java webstart.

    I might as well give you the link to the page (which I should have done to start with) and you can see what I mean: http://www.shahspace.com/jws/mazemania/mazemania.html

    I'll have to research how to configure my server to send http headers.

  6. #6
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    if you use php, you can use the header() function:
    PHP Code:
    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past 
    I'm sure other server-side languages have similar capabilities. the server itself (e.g., Apache) can be configured to do so as well.

Bookmarks

Posting Permissions

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