in reply to Predictive HTTP caching in Perl

Is it really worth your time to save a couple of seconds?

You could cache the data, then send conditional GET requests to fetch the resources whenever you need them. If the server tells you the page hasn't been updated, you use the cache. If it has been updated, the server sends you the new data and you use that.

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re^2: Predictive HTTP caching in Perl
by ryantate (Friar) on May 03, 2006 at 05:53 UTC
    That is exactly how I was planning to update the cache, but the question is concerning how I figure out *when* to update the cache.

    I'm also planning to use Keep-Alive in cases where I need multiple items from the same server, if that's of interest to you as well. But it's sort of beside the point.

    And yes, it would be worth it to save a couple of seconds, if I learned lessons that would let me implement such a cache for an arbitrary collection of Web pages for an arbitrary user. The difference between 1-2 seconds response time and 5-10 seconds makes all the difference in the world for a Web application.

    Obviously, with multiple users, the value of a conventional cache goes up. But I am interested in pre-fetching, so I reduced my question to the simplest case (which happens to be the only real one at the moment).

Re^2: Predictive HTTP caching in Perl
by ryantate (Friar) on May 04, 2006 at 01:44 UTC
    Having been pointed at conditional GET a second time by perrin below, I want to say thanks for the link. I did plan to use it but did not understand how useful it could be, as one can ping servers more often with it than a conventional GET while still being considered well-mannered. Thanks.