Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

How to cache openSUSE repositories with Squid is another, different example of a use case where picking a URL that's already cached is valuable.

...

When it sees a response with a "Location: ..." header and a "Digest: SHA-256=..." header, it checks if the URL in the Location header is already cached. If it isn't, then it tries to find a URL that is cached to use instead. It looks in the cache for some object that matches the digest in the Digest header and if it succeeds, then it rewites the Location header with that object's URL.

This way a client should get sent to a URL that's already cached and won't download the file again.

...

Just build the plugin and add it to your plugin.config file.

...