develooper Front page | perl.libwww | Postings from October 2019

Re: retrieving date+time stamp of remote object

Thread Previous | Thread Next
From:
L A Walsh
Date:
October 23, 2019 20:30
Subject:
Re: retrieving date+time stamp of remote object
Message ID:
5DB0B855.7050706@tlinx.org
On 2019/10/21 17:39, Bradley Dean wrote:
>
> Using if-modified-since relies on the server you're querying supporting that
----
It "seems" it must support it separately, "I guess"...because (see below)...

>> Anyone know the call/header value to use for getting at the remote
>> object's last-modified time directly?
>>     
>
> You can check what headers are available by using a HEAD request before you GET - then you can make the call to download or not.
>   
    I printed out all the headers -- unfortunately there was no
'last-modified'
value for the object (even though the directory listing for it shows a
timestamp).  Nevertheless, somehow it has to know since the 'mirror' method
seems to work. 

    Something weird might be going on since there is a squid-proxy
between me
and the content.  Very strange.  Note that the mirror method works, but
when I
tried to do similar, manually, I only got that my local copy was 'fresh'
until
the cache expiration time had passed, then it downloaded it again.

    But with the mirror method, it seems to only download it once and
sync with the remote.  Strange.


    One thing I was curious about -- when I call mirror (vs. get), I get
back
an HTTP::Response object.  One of the fields of that object is the
'content' value.  I'm wondering if that is read in dynamically if
'accessed', since I'm
pulling down RPM packages which can be rather large (the 10 largest packages
are over 1GB each!).  It certainly wouldn't just store them in the response
object, by default (would it?), since if I had references to several objects
at the same time, in memory, that could be a huge memory load.

    I can see I'm gonna want to find a way to filter some of these packages
before I mirror them since I don't really need the debuginfo for
multiple kernel
versions I'm not running nor various cross-compiler packages (Oi!)

   Whether dynamic or not, guess I'll find out -- can't believe how huge
some of those packages are!

Thanks!

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About