[Rubygems-developers] Cache files etc.

Hugh Sasse hgs at dmu.ac.uk
Fri Oct 28 14:09:04 EDT 2005


As far as I can see from the code (and there's a lot going on in
this area with different cache locations etc) the cache just holds
the yaml from yaml.Z and holds no metadata about it.  It checks to
see if it has the current version by comparing sizes with the one at
gems.rubyforge.org.

Am I right in thinking that the cache is one flat file?  I'm
wondering if it would spoil anything to have a metafile along with
it.  I see that the server which gives us the yaml.Z file is
presently running Apache 1.x.y, and is thus limited in some respects
as to how we can modify it (in comparison to what we could do to a
pure ruby implemented server, I mean).  But it is sending out Etags
with the Yaml file, which means we should be able to avoid simple
size comparisons, and actually get the server to send us the file
iff it is modified.  Use the GET with the

"If-Modified-Since: #{etag}"

header.  But, also, should the server ever support it we would be
able to use RFC3229 with this, provided we kept the etag somewhere,
and provided the server had enough space to keep N back issues of
the yaml.Z file and, either store the differences, or if it has
enoguh power, generate the differences on demand.  But none of this
can happen without storing metadata in the cache.

Anyone more familiar with the code (that's most of you :-)) care to
comment?

        Thank you
        Hugh


More information about the Rubygems-developers mailing list