emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ETag support for URL and a few questions


From: Mark Plaksin
Subject: ETag support for URL and a few questions
Date: Sat, 06 May 2006 22:04:18 -0400
User-agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.51 (gnu/linux)

Attached are two small patches which add ETag support[1] to the URL
package.  An ETag is an arbitrary string which is used along with
If-Modified-Since to determine whether a page has been modified.  It's used
a lot in blogging software and other places too.

I while back added ETag to my copy of Gnus' nnrss but recently realized
that it would be better (and much easier) to put it into the URL package.

The url-cache.el patch also make url-cache-extract check whether the cache
file exists before trying to insert it.

While working on this I noticed that url-automatic-caching defaults to nil.
Why not default to t?  Because nothing automatically cleans up the cache?
Things are much faster when caching is on.

Also, url-http-create-request uses the long name for the day of the week
when creating the If-Modified-Since header.  The HTTP RFC[2] says the
abbreviated name is preferred.  This could be fixed by reordering
url-weekday-alist so the short names come first.

Finally, url-is-cached returns the lastmod time of the cache *file* instead
of the value of the Last-Modified header inside the cache file.  For HTTP
it would be better if it used the value of the Last-Modified header.

The HTTP RFC[3] says that either should work but mentions that lack of time
sync between the client and the server could cause trouble.  I seem to have
found two or three blog packages fail to do the right thing unless they get
are sent the value of Last-Modified header that they supplied.  Also,
somebody could use cp to move their URL cache around and then everything in
it would suddenly be very fresh.

If you like my patches and agree that url-is-cached should be changed for
HTTP, url-cache-get-header should probably be changed to accept a list of
headers to find and to return an alist of headers and their values.

OK, shoot me down :)

PS:  I know the release is soon; I'm not picky about when these potential
changes might get applied.

Footnotes: 
[1]  HTTP RFC about ETag & and a description of how to use it with RSS
feeds:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11
http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers

[2]  http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1

[3]  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25

Attachment: url-http.el.patch
Description: etag support

Attachment: url-cache.el.patch
Description: etag support


reply via email to

[Prev in Thread] Current Thread [Next in Thread]