# Obtaining metadata from a url or web to for avoid loadit

**URL:** <https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253>\
**Category:** Ruby\
**Created:** [September 20, 2010, 4:16pm UTC](https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253 "2010-09-20T16:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saknarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@saknarede](https://www.ruby-forum.com/u/saknarede)\
**Post date:** [September 20, 2010, 4:16pm UTC](https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253/1 "2010-09-20T16:16:48Z")

</div>

Hi!

I was googling a lot with very different queris to find an answer, lets  
see:  
I’m programming a script who work with web files (html and rss), the  
program check if exists modifications in tons of urls. It was wondering  
if I could check the data modification (like a local file) to avoid to  
download the file and load to memory (for compare with cached files) if  
the file didn’t change.

The question is: are there a method to know the modified date (or other  
metada) of a file from the url?

I hope the question was clear and tanks for your time.

---

<div class="post-metadata">

**Author:** ![saknarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@saknarede](https://www.ruby-forum.com/u/saknarede)\
**Post date:** [September 20, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253/2 "2010-09-20T16:23:28Z")

</div>

On Mon, Sep 20, 2010 at 7:16 AM, Sak … [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The question is: are there a method to know the modified date (or other  
> metada) of a file from the url?

See the request methods section of

[http://www.w3.org/Protocols/rfc2616/rfc2616.html](http://www.w3.org/Protocols/rfc2616/rfc2616.html)

---

<div class="post-metadata">

**Author:** ![saknarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@saknarede](https://www.ruby-forum.com/u/saknarede)\
**Post date:** [September 20, 2010, 10:26pm UTC](https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253/3 "2010-09-20T22:26:55Z")

</div>

Hassan S. wrote:

> On Mon, Sep 20, 2010 at 7:16 AM, Sak … [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > The question is: are there a method to know the modified date (or other  
> > metada) of a file from the url?
> 
> See the request methods section of
> 
> [http://www.w3.org/Protocols/rfc2616/rfc2616.html](http://www.w3.org/Protocols/rfc2616/rfc2616.html)

Thanks for the info, but I can’t find anything about the question.

---

<div class="post-metadata">

**Author:** ![saknarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@saknarede](https://www.ruby-forum.com/u/saknarede)\
**Post date:** [September 20, 2010, 10:52pm UTC](https://www.ruby-forum.com/t/obtaining-metadata-from-a-url-or-web-to-for-avoid-loadit/195253/4 "2010-09-20T22:52:48Z")

</div>

On Mon, Sep 20, 2010 at 1:26 PM, Sak … [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > See the request methods section of
> > 
> > [http://www.w3.org/Protocols/rfc2616/rfc2616.html](http://www.w3.org/Protocols/rfc2616/rfc2616.html)
> 
> Thanks for the info, but I can’t find anything about the question.

9.4 HEAD

The HEAD method is identical to GET except that the server MUST NOT  
return a message-body in the response. The metainformation contained  
in the HTTP headers in response to a HEAD request SHOULD be identical  
to the information sent in response to a GET request. This method can  
be used for obtaining metainformation about the entity implied by the  
request without transferring the entity-body itself. This method is  
often used for testing hypertext links for validity, accessibility,  
and recent modification.

Also,

13.3.1 Last-Modified Dates
