Mailinglist Archive: mirror (3 mails)

< Previous Next >
[suse-mirror] Cache-Control headers for metadata
Hi,

for all of you serving mirrored openSUSE content via HTTP, I have a
little pointer which increases service quality for our users.

The idea is to mark the metadata files with cache control headers that
indicate that they are not served from an intermediary (proxy) cache
without checking for freshness before.

Add the following to your Apache config, outside of a directory context.
mod_headers and mod_expires need to be loaded.

<LocationMatch "\.(xml|xml\.gz|xml\.asc)">
Header set Cache-Control "must-revalidate"
ExpiresActive On
ExpiresDefault "now"
</LocationMatch>


This is (the essence of) what we use at download.opensuse.org since two
years, and it makes sense to have this configuration on your mirrors for
those occasional users who access mirrors directly.

This greatly reduces the risk that users see inconsistencies (one file
being served stale from the cache, another one served fresh from the
origin server). And it doesn't sacrifice good cacheability.

This is one of the reasons why HTTP is preferrable over FTP, because FTP
has no means of cache control at all.

The thing is that intermediaries, in default configuration, may keep
content cached basically arbitrarily between 6 and 24 hours, if it
doesn't come with directions about caching.

Since we won't be able to rely on _all_ mirrors marking the content
appropriately (and in few cases even FTP is used), we will still deliver
such files directly instead of redirecting them; however, there'll
always be users acessing mirrors directly, and they will benefit from
the above configuration.

Thanks!
Peter
--
Contact: admin@xxxxxxxxxxxx (a.k.a. ftpadmin@xxxxxxxx)
#opensuse-mirrors on freenode.net
Info: http://en.opensuse.org/Mirror_Infrastructure

SUSE LINUX Products GmbH
Research & Development
< Previous Next >
This Thread
  • No further messages