in reply to Is LWP::Simple's get function caching pages?

No, LWP::Simple doesn't cache pages, but something else might. If there is no intermediate proxy, check the webserver itself. It'll probably will show the same problem in a browser.

Is this a statical page (a file) that you change on the server? In such a case, Apache is known to cache pages for a while.

A simple solution for such a problem is to replace the statical page on the server with a CGI script that returns the file contents, preceded with an appropriate content-type header and a blank line. It's either that, or finding a way to tell the server not to cache the files. I wouldn't know how, though.

  • Comment on Re: Is LWP::Simple's get function caching pages?

Replies are listed 'Best First'.
Re^2: Is LWP::Simple's get function caching pages?
by CombatSquirrel (Hermit) on Sep 18, 2004 at 08:29 UTC
    You're right about the browser behaving the same way, but reloading the page solved it. I would have supposed that to be a sign that the browser caches the page, not the server. I don't think that LWP::Simple inherits browser settings, though. That leaves me with my ISP possibly caching pages, although I can't figure why a reload would solve the problem in this case.
    And I definitely can't change the page itself (it's Yahoo's weather service - and yes, I checked: the terms of service don't seem to forbid the collection of weather data).
    Thanks for your help.
    CombatSquirrel.

    Entropy is the tendency of everything going to hell.
      No, force-reloading the page probably sent along extra headers to the webserver, telling it to reread the file.

      Now, if you can figure out what those headers are, you can duplicate that behaviour with LWP, though you're probably will have to use something slightly more powerful (= lower level) than LWP::Simple.

        I thought about requesting the file twice, which might look to the server as if I were reloading the file. The problem resolved magically, though (maybe because it's daytime now and more people are accessing the page) and I'll just leave it with that for now (I'll see whether the problem reappears tonight).
        Thanks for your responses.
        CombatSquirrel.

        Entropy is the tendency of everything going to hell.