Cache problem

Discussion in 'General' started by palb, Feb 20, 2008.

  1. mistwang

    mistwang LiteSpeed Staff

    It confirms that Rails is handling the request, LSWS just relay the response from rails.

    You can try killing all ruby processes, so if a ruby process cache the rhtml, it will be flushed when next request comes in and LSWS start another set of ruby processes.

    To find out what happened in Rails, you can strace/truss the ruby process, it will show the system calls for serving that request. For rhtml page, you will see related system calls operating on the rhtml file.

    Same solution for the other problem, strace the ruby process that serving the request will show what went wrong in rails.
  2. palb

    palb Well-Known Member

    Ok. I'll try that.

    What about running on WEBrick? Shouldn't the same issue occur?
  3. mistwang

    mistwang LiteSpeed Staff

    Rails may not behave exactly the same due the differences I mentioned earlier.

    You can strace WEBrick as well and compare the output. Actually, it is a good way to trouble shoot this kind of problem.
  4. palb

    palb Well-Known Member

    Would still put my money on an LS issue. PHP sites behaves the same. Can't overwrite files after they've been rendered in the browser, until after a while.
  5. mistwang

    mistwang LiteSpeed Staff

    May you need to check if a expires header has been added or not.

    LSWS do not even open those PHP or rhtml files at all, how can those files be locked by LSWS?

    You can verify the file content have been changed or not by viewing it from command line.
    Your conclusion that LS prevent file being overwritten is completely wrong.

    The old file content may be cached somehow somewhere, but definitely not LSWS. Those files are not handled by LSWS at all.

    It is a bit tricky for application to detect file changes if the old file is removed and replaced by a new file, if old file is opened by an application, the application will not reload the new file without special code to detect the change. LSWS has such code built-in, if you change a static file served by LSWS, LSWS will load the new file. It is a problem for the process that directly handle those files.

    I am not going to respond to this unless you can provide some solid evidences, not just speculations.
  6. palb

    palb Well-Known Member

    An expires header in the browser? No I don't think so.

    I don't know what it does and I'm unsure what to look for, besides the request hitting the server (which has nothing to do with overwriting). The only thing I know is that this will only happen when LS is involved. It doesn't happen with WEBrick, mongrel, Apache, and I've never had this issue with e.g. Lasso or WebStar. The same when issue occurs with any other browser, also IE 7.

    Sorry I can't be more specific. These are my only clues. And the fact that you can make a Graceful Restart and LS will somehow have the files stored in a cache somewhere. That's why I and my colleague suspect LS.

    Thanks anyway.

Share This Page